I have a button:
<Button x:Name="MyButton" Command="SomeCommand"/>
Is there a way to execute the command from source? Calling the click on the button does not help:
MyButton.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
I mean - this does raise the event, but it does not raise the command. Is there something similar to this RaiseEvent
but just for Command? If there is not - how can I instantiate ExecutedRoutedEventArgs
? Is it possible?
Lastly - please do not tell me how to avoid
calling the command.