void OnDeleteAnnotationCommandCanExecute(object sender, CanExecuteRoutedEventArgs e) { if (EditingContextUtilities.GetSingleSelectedModelItem(this.Context) == this.ModelItem) { ContextMenuUtilities.OnDeleteAnnotationCommandCanExecute(e, this.Context, this.FindSwitch()); } }
void OnEditAnnotationCommandCanExecute(object sender, CanExecuteRoutedEventArgs e) { if (EditingContextUtilities.GetSingleSelectedModelItem(this.Context) == this.ModelItem) { // call the same method as delete annotation command ContextMenuUtilities.OnDeleteAnnotationCommandCanExecute(e, this.Context, this.FindTryCatch()); } }
void OnDeleteAnnotationCommandCanExecute(object sender, CanExecuteRoutedEventArgs e) { if (EditingContextUtilities.GetSingleSelectedModelItem(this.Context) == this.ModelItem) { e.CanExecute = false; e.Handled = true; } }