Пример #1
0
        /// <summary>
        ///
        /// </summary>
        public void ConnectionDragging(ConnectionDraggingEventArgs arg)
        {
            LinkViewModel m = arg.Connection as LinkViewModel;

            if (m == null)
            {
                return;
            }

            // 位置を更新
            if (m.SourceConnector != null)
            {
                m.End = arg.Position;
            }
            else
            {
                m.Start = arg.Position;
            }
        }
Пример #2
0
        /// <summary>
        /// ドラッグ中
        /// </summary>
        private void ConnectorItem_Dragging(object sender, ConnectorDraggingEventArgs e)
        {
            var ctrl = e.OriginalSource as ConnectorControl;

            if (ctrl == null || draggingLinkModel_ == null)
            {
                return;
            }

            // ドラッグ中イベント起動
            var position = Mouse.GetPosition(ctrl.ParentEditControl);
            //Console.WriteLine("{0}, {1}", position.X, position.Y);
            var connectionDraggingEventArgs = new ConnectionDraggingEventArgs(ConnectionDraggingEvent, this,
                                                                              ctrl.ParentNodeControl.DataContext, draggingLinkModel_, ctrl.DataContext, position);

            RaiseEvent(connectionDraggingEventArgs);

            // ドラッグオーバーチェック(現状必要ない)
            //position = Mouse.GetPosition(MainCanvas);
            //if (CheckConnectorControlDraggedOver(position, out dragOverConnector_)) {
            //Console.WriteLine("Over!");
            //}
        }
Пример #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void NodeEditControl_ConnectionDragging(object sender, ConnectionDraggingEventArgs e)
 {
     NodeEditViewModel.ConnectionDragging(e);
 }