public void ClearDrawingPanel() { DrawnShapes.Clear(); SelectedShapes.Clear(); CreateMemento(); _g.RefreshView(); }
public void SetState(List <IShape> drawnShapes, ToolBar toolbar) { DrawnShapes.Clear(); foreach (var shape in drawnShapes) { DrawnShapes.Add((IShape)shape.Clone()); } ToolBar = (ToolBar)toolbar.Clone(); }
public void RestoreState(Memento newState) { DrawnShapes.Clear(); SelectedShapes.Clear(); foreach (var shape in newState.DrawnShapes) { DrawnShapes.Add((IShape)shape.Clone()); } ToolBar = (ToolBar)newState.ToolBar.Clone(); _g.RefreshView(); _g.RefreshToolBar(); }
private void Clear_Clicked(object sender, RoutedEventArgs e) { DrawnShapes.Clear(); HideEditPanel(); DrawnShapesCombo.ItemsSource = null; DrawnShapesCombo.ItemsSource = DrawnShapes; if (ShapeToEdit != null) { ShapeToEdit.Mode = ShapeModes.Drawn; ShapeToEdit = null; } canvasControl.Invalidate(); }