protected override void RemoveSide() { var index = sides.Count - 1; if (index > 2) { var firstSide = sides[index - 1]; firstSide.UnregisterFromDependencies(); firstSide.Dependencies[1] = this.Dependencies[1]; firstSide.RegisterWithDependencies(); } var side = sides[index]; side.UnregisterFromDependencies(); sides.RemoveLast(); var drawing = Drawing; var action = new RemoveFigureAction(drawing, side); action.Execute(); Children.Remove(side); if (Drawing != null) { side.OnRemovingFromCanvas(Drawing.Canvas); } }
protected void RemoveVertex() { var vertex = vertices[vertices.Count - 1]; vertex.UnregisterFromDependencies(); vertices.RemoveLast(); var drawing = vertex.Drawing; var action = new RemoveFigureAction(drawing, vertex); action.Execute(); Children.Remove(vertex); if (Drawing != null) { vertex.OnRemovingFromCanvas(Drawing.Canvas); } }