protected override void OnMouseUp(MouseButtonEventArgs e) { if (HitConnector != null) { var sourceConnector = this.sourceConnector; var sinkConnector = HitConnector; diagram.Add(sourceConnector, sinkConnector); } if (HitBlock != null) { HitBlock.IsDragConnectionOver = false; } if (IsMouseCaptured) { ReleaseMouseCapture(); } AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(diagram); if (adornerLayer != null) { adornerLayer.Remove(this); } }
private void AddModel(object sender, BlockViewModel model) { DiagramCanvas.Add(model); }