public void CaptureArcFormattingCommandOnExecuted(object sender, ExecutedRoutedEventArgs e) { if (arcShape == null) { if (SelectedAddItem.Contains("Arc")) { arcShape = (string)Application.Current.Resources[SelectedAddItem]; } else if (windowsMgr.activeGraphCanvas.Selection.SelectedArc != null) { arcShape = ((DisplayShape)windowsMgr.activeGraphCanvas.Selection.SelectedArc. DisplayShape).String; } if (arcShape != null) { var s = (Path)MyXamlHelpers.Parse(arcShape); s.RenderTransform = new MatrixTransform(); ApplyArcFormatVB.Child = (Shape)MyXamlHelpers.Parse(arcShape); } txtblkCaptureArcFormat.Text = "Release Arc Format"; txtblkCaptureArcFormat.Foreground = Brushes.Red; SetSelectedAddItem(0); } else { arcShape = null; ApplyArcFormatVB.Child = null; txtblkCaptureArcFormat.Text = "Capture Arc Format"; txtblkCaptureArcFormat.Foreground = Brushes.Black; } }
public void CaptureNodeFormattingCommandCanExecute(object sender, CanExecuteRoutedEventArgs e) { e.CanExecute = (nodeShape != null || (windowsMgr.activeGraphCanvas != null && windowsMgr.activeGraphCanvas.Selection != null && windowsMgr.activeGraphCanvas.Selection.selectedNodes.Count >= 1) || (SelectedAddItem.Contains("Node"))); }