예제 #1
0
 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));
        }
예제 #4
0
        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));
        }
예제 #5
0
 private void RefreshEnabledButtons()
 {
     SaveImageButton.IsEnabled = image.Source != null && strokesService.GetStrokes().Any();
     ClearAllButton.IsEnabled  = image.Source != null || strokesService.GetStrokes().Any();
 }