internal object OnConnectionDragStarted(OutputConnectorViewModel sourceConnector, Point currentDragPoint) { var connection = new ConnectionViewModel(sourceConnector) { FromPosition = currentDragPoint }; Connections.Add(connection); return(connection); }
internal void OnConnectionDragCompleted(Point currentDragPoint, ConnectionViewModel newConnection, OutputConnectorViewModel sourceConnector) { var nearbyConnector = FindNearbyInputConnector(currentDragPoint); if (nearbyConnector == null || sourceConnector.Owner == nearbyConnector.Owner) { Connections.Remove(newConnection); return; } var existingConnection = nearbyConnector.Connection; if (existingConnection != null) { Connections.Remove(existingConnection); } newConnection.To = nearbyConnector; }