/// <summary> /// Evaluates whether the strokes are retraces /// </summary> private void maybeReplaceStrokes() { if (originalStrokes.Count == 0 || overlapStrokes.Count == 0 || messageBoxOpen) { return; } messageBoxOpen = true; messageBox(); MessageBoxResult result = MessageBox.Show("Replace strokes?", "", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { CommandList.RedrawCmd redrawCmd = new CommandList.RedrawCmd(sketchPanel, originalStrokes, overlapStrokes); redrawCmd.StrokesAdded += new CommandList.StrokesAddedEventHandler(Group); commandManager.ExecuteCommand(redrawCmd); } originalStrokes.Clear(); overlapStrokes.Clear(); messageBoxOpen = false; }
/// <summary> /// Removes strokes in an undo-able way. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void inkPic_StrokeErasing(object sender, InkCanvasStrokeErasingEventArgs e) { CM.ExecuteCommand(new CommandList.StrokeRemoveCmd(ref inkSketch, e.Stroke)); InkChanged(false); }