public void RemoveShape(int shapeId) { Shape temp = ShapesItemsSource.FirstOrDefault(s => s.ID == shapeId); if (temp != null) { ShapesItemsSource.Remove(temp); } }
public void AddShape(Shape shape) { var tempShape = ShapesItemsSource.FirstOrDefault(s => s.ID == shape.ID); if (tempShape != null) { EditGeometryAction = EditGeometry.Action.EditCanceled; ShapesItemsSource.Remove(tempShape); } ShapesItemsSource.Add(shape); }