예제 #1
0
 private void OnGraphControlConnectionDragStarted(object sender, ConnectionDragStartedEventArgs e)
 {
     var sourceConnector = (ConnectorViewModel) e.SourceConnector.DataContext;
     var currentDragPoint = Mouse.GetPosition(GraphControl);
     var connection = ViewModel.OnConnectionDragStarted(sourceConnector, currentDragPoint);
     e.Connection = connection;
 }
예제 #2
0
        private void OnConnectorItemDragStarted(object sender, ConnectorItemDragStartedEventArgs e)
        {
            e.Handled = true;

            _draggingSourceConnector = (ConnectorItem)e.OriginalSource;

            var eventArgs = new ConnectionDragStartedEventArgs(ConnectionDragStartedEvent, this,
                                                               _draggingSourceConnector.ParentElementItem, _draggingSourceConnector);

            RaiseEvent(eventArgs);

            _draggingConnectionDataContext = eventArgs.Connection;

            if (_draggingConnectionDataContext == null)
            {
                e.Cancel = true;
            }
        }
예제 #3
0
        private void OnConnectorItemDragStarted(object sender, ConnectorItemDragStartedEventArgs e)
        {
            e.Handled = true;

            _draggingSourceConnector = (ConnectorItem) e.OriginalSource;

            var eventArgs = new ConnectionDragStartedEventArgs(ConnectionDragStartedEvent, this, 
                _draggingSourceConnector.ParentElementItem, _draggingSourceConnector);
            RaiseEvent(eventArgs);

            _draggingConnectionDataContext = eventArgs.Connection;

            if (_draggingConnectionDataContext == null)
                e.Cancel = true;
        }