public void DeleteDiagram(DiagramModel diagram) { CurrentProject.RemoveDiagram(diagram); var diagramViewModel = Diagrams.FirstOrDefault(m => m.Model == diagram); if (diagramViewModel != null) { Diagrams.Remove(diagramViewModel); } }