How can I get access to the related MenuItem
? It has been created on the fly, so I cannot just use it by a name in the xaml file.
private void menuItem_canExecute(object sender, CanExecuteRoutedEventArgs e)
{
var snd = sender; // This is the main window
var orgSource = e.OriginalSource; // This is a RichTextBox;
var src = e.Source; // This is a UserControl
// I think I must use the Command, but how?
RoutedCommand routedCommand = e.Command as RoutedCommand;
}