Ejemplo n.º 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;
 }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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;
        }