Example #1
0
 public void ClearDrawingPanel()
 {
     DrawnShapes.Clear();
     SelectedShapes.Clear();
     CreateMemento();
     _g.RefreshView();
 }
Example #2
0
        public void SetState(List <IShape> drawnShapes, ToolBar toolbar)
        {
            DrawnShapes.Clear();
            foreach (var shape in drawnShapes)
            {
                DrawnShapes.Add((IShape)shape.Clone());
            }

            ToolBar = (ToolBar)toolbar.Clone();
        }
Example #3
0
 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();
 }
Example #4
0
        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();
        }