Example #1
0
        internal void OnConnectionDragging(Point currentDragPoint, ConnectionViewModel connection)
        {
            var nearbyConnector = FindNearbyInputConnector(currentDragPoint);

            connection.ToPosition = (nearbyConnector != null)
                ? nearbyConnector.Position
                : currentDragPoint;
        }
Example #2
0
        internal object OnConnectionDragStarted(OutputConnectorViewModel sourceConnector, Point currentDragPoint)
        {
            var connection = new ConnectionViewModel(sourceConnector)
            {
                FromPosition = currentDragPoint
            };

            Connections.Add(connection);

            return(connection);
        }
Example #3
0
        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;
        }