private void ElementDeleteHandler(object sender, Microsoft.VisualStudio.Modeling.ElementDeletedEventArgs e) { if (_model.IsLoading) { return; } _findControl.SetupObjects(_model, _diagram, _docView); }
/// <summary> /// Remove nested children. /// </summary> /// <param name="args"></param> protected override void OnNestedChildShapeElementRemoved(Microsoft.VisualStudio.Modeling.ElementDeletedEventArgs args) { NodeShapeReferencesNestedChildren con = args.ModelElement as NodeShapeReferencesNestedChildren; NodeShape nodeShape = con.ChildShape; if (nodeShape != null) { for (int i = this.Diagram.Children.Count - 1; i >= 0; i--) { if (this.Diagram.Children[i].ShapeElement.Id == nodeShape.Id) { this.Diagram.RemoveElement(this.Diagram.Children[i]); } } } }