public void ResetPartialConnection() { if (_partialConnection != null) { var diagram = _partialConnection.SourceConnectorInfo.DesignerItem.Diagram; diagram.RemoveItemCommand.Execute(_partialConnection); } _partialConnection = null; if (SourceConnector != null) SourceConnector.IsBuildingConnection = false; if (SinkConnector != null) SinkConnector.IsBuildingConnection = false; SourceConnector = null; SinkConnector = null; }
protected override void OnMouseUp(MouseButtonEventArgs e) { //if (IsMouseCaptured) // ReleaseMouseCapture(); if (SourceConnector != null) SourceConnector.IsBuildingConnection = false; if (SinkConnector != null) SinkConnector.IsBuildingConnection = false; //if (SourceConnector != null && SinkConnector != null && SinkConnector.ConnectorInfo.CanEndConnection) //{ // var fullyCreatedSourceInfo = SourceConnector.ConnectorInfo; // var diagram = fullyCreatedSourceInfo.DesignerItem.Diagram; // var newConnection = new ConnectionViewModel(fullyCreatedSourceInfo.DesignerItem.Diagram, // SourceConnector.ConnectorInfo, SinkConnector.ConnectorInfo); // diagram.AddItemCommand.Execute(newConnection); //} if (SourceConnector != null && _partialConnection != null) { var sourceConnectorInfo = (FullyCreatedConnectorInfo) SourceConnector.DataContext; sourceConnectorInfo.DesignerItem.Diagram.RemoveItemCommand.Execute(_partialConnection); } _partialConnection = null; SourceConnector = null; SinkConnector = null; }