public void RemoveSelected() { if (ShapeList.Count != 0) { foreach (var item in ShapeList.ToArray()) { if (Selection.Contains(item)) { Selection.Remove(item); ShapeList.Remove(item); } } } }