Back in WinForms it was really easy to simulate a user clicking a Button, you just call a Button’s PerformClick method. For some reason the WPF Button does not have that method. It turns out that you need to enter into the automation world to accomplish this task.
Here’s the code:
ButtonAutomationPeer peer =
new ButtonAutomationPeer( someButton );
IInvokeProvider invokeProv =
peer.GetPattern( PatternInterface.Invoke )