Update WPF xaml Form from Code before execution ends

I’m just starting to get into wpf and I want to do something which is pretty easy in winforms, but I can’t find how to do with WPF. I have a long running process and I want the button that kicks it off to be disabled once it’s clicked and then re-enable when the code stops running. It’s not a background task.

Thanks!