関連する にアクセスするにはどうすればよいMenuItemですか? オンザフライで作成されているため、xaml ファイルの名前だけで使用することはできません。
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;
}