我怎样才能获得相关的访问权限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;
}