private void RefreshEnabledButtons() { UndoButton.IsEnabled = undoRedoService.CanUndo; RedoButton.IsEnabled = undoRedoService.CanRedo; SaveInkFileButton.IsEnabled = strokeService.GetStrokes().Any(); TransformTextAndShapesButton.IsEnabled = strokeService.GetStrokes().Any(); ClearAllButton.IsEnabled = strokeService.GetStrokes().Any() || transformService.HasTextAndShapes(); }
private void RefreshEnabledButtons() { CutButton.IsEnabled = copyPasteService.CanCut; CopyButton.IsEnabled = copyPasteService.CanCopy; PasteButton.IsEnabled = copyPasteService.CanPaste; UndoButton.IsEnabled = undoRedoService.CanUndo; RedoButton.IsEnabled = undoRedoService.CanRedo; SaveInkFileButton.IsEnabled = strokeService.GetStrokes().Any(); ExportAsImageButton.IsEnabled = strokeService.GetStrokes().Any(); ClearAllButton.IsEnabled = strokeService.GetStrokes().Any(); }
private void ClearAll_Click(object sender, RoutedEventArgs e) { var strokes = strokeService?.GetStrokes().ToList(); ClearSelection(); strokeService?.ClearStrokes(); undoRedoService?.AddOperation(new RemoveStrokeUndoRedoOperation(strokes, strokeService)); }
private void ClearAll_Click(object sender, RoutedEventArgs e) { var strokes = strokeService?.GetStrokes().ToList(); var textAndShapes = transformService?.GetTextAndShapes().ToList(); ClearSelection(); strokeService.ClearStrokes(); transformService.ClearTextAndShapes(); undoRedoService.AddOperation(new ClearStrokesAndShapesUndoRedoOperation(strokes, textAndShapes, strokeService, transformService)); }
private void RefreshEnabledButtons() { SaveImageButton.IsEnabled = image.Source != null && strokesService.GetStrokes().Any(); ClearAllButton.IsEnabled = image.Source != null || strokesService.GetStrokes().Any(); }