public override void Clean() { _sourceWatcher?.Dispose(); _targetWatcher?.Dispose(); if (Source != null) { Source.PositionChanged -= source_PositionChanged; } if (Target != null) { Target.PositionChanged -= source_PositionChanged; } _oldSource = _oldTarget = null; Source = null; Target = null; Edge = null; RootArea = null; HighlightBehaviour.SetIsHighlightEnabled(this, false); DragBehaviour.SetIsDragEnabled(this, false); Linegeometry = null; LinePathObject = null; SelfLoopIndicator = null; if (EdgeLabelControl != null) { EdgeLabelControl.Dispose(); EdgeLabelControl = null; } if (EdgePointerForSource != null) { EdgePointerForSource.Dispose(); EdgePointerForSource = null; } if (EdgePointerForTarget != null) { EdgePointerForTarget.Dispose(); EdgePointerForTarget = null; } EventOptions?.Clean(); }