@@ -92,19 +92,9 @@ private void SetupEvents()
9292 this . WhenActivated ( disposable =>
9393 {
9494 this . Form . Events ( ) . MouseLeftButtonDown . Subscribe ( e => ConnectDrag ( e ) ) . DisposeWith ( disposable ) ;
95-
9695 this . Text . Events ( ) . LostFocus . Subscribe ( e => Validate ( e ) ) . DisposeWith ( disposable ) ;
97-
98- this . Text . Events ( ) . PreviewMouseLeftButtonDown . Subscribe ( e => TextDrag ( e ) ) . DisposeWith ( disposable ) ;
99- this . Text . Events ( ) . PreviewDrop . Subscribe ( e => TextDrop ( e ) ) . DisposeWith ( disposable ) ;
100- this . Text . Events ( ) . PreviewDragOver . Subscribe ( e => TextDragOver ( e ) ) . DisposeWith ( disposable ) ;
101- this . Text . Events ( ) . PreviewDragEnter . Subscribe ( e => TextDragEnter ( e ) ) . DisposeWith ( disposable ) ;
102- this . Text . Events ( ) . PreviewDragLeave . Subscribe ( e => TextDragLeave ( e ) ) . DisposeWith ( disposable ) ;
103-
10496 this . Grid . Events ( ) . PreviewMouseLeftButtonDown . Subscribe ( e => ConnectorDrag ( e ) ) . DisposeWith ( disposable ) ;
10597 this . Grid . Events ( ) . PreviewDragEnter . Subscribe ( e => ConnectorDragEnter ( e ) ) . DisposeWith ( disposable ) ;
106- this . Grid . Events ( ) . PreviewDragOver . Subscribe ( e => ConnectorDragOver ( e ) ) . DisposeWith ( disposable ) ;
107- this . Grid . Events ( ) . PreviewDragLeave . Subscribe ( e => ConnectorDragLeave ( e ) ) . DisposeWith ( disposable ) ;
10898 this . Grid . Events ( ) . PreviewDrop . Subscribe ( e => ConnectorDrop ( e ) ) . DisposeWith ( disposable ) ;
10999
110100
@@ -118,7 +108,7 @@ private void Validate(RoutedEventArgs e)
118108 }
119109
120110 private void ConnectDrag ( MouseButtonEventArgs e )
121- {
111+ {
122112 this . ViewModel . CommandConnectPointDrag . Execute ( ) ;
123113 DataObject data = new DataObject ( ) ;
124114 data . SetData ( "Node" , this . ViewModel . Node ) ;
@@ -127,70 +117,20 @@ private void ConnectDrag(MouseButtonEventArgs e)
127117 e . Handled = true ;
128118 }
129119
130- private void TextDrag ( MouseButtonEventArgs e )
131- {
132- ConnectorDrag ( e ) ;
133- e . Handled = true ;
134- }
135-
136- private void TextDragOver ( DragEventArgs e )
137- {
138- ConnectorDragOver ( e ) ;
139- e . Handled = true ;
140- }
141-
142- private void TextDragEnter ( DragEventArgs e )
143- {
144- ConnectorDragEnter ( e ) ;
145- e . Handled = true ;
146- }
147-
148- private void TextDragLeave ( DragEventArgs e )
149- {
150- ConnectorDragLeave ( e ) ;
151- e . Handled = true ;
152- }
153-
154- private void TextDrop ( DragEventArgs e )
155- {
156- ConnectorDrop ( e ) ;
157- e . Handled = true ;
158- }
159-
160120 private void ConnectorDrag ( MouseButtonEventArgs e )
161121 {
122+
162123 if ( ! this . ViewModel . TextEnable )
163124 return ;
164-
125+ if ( ! Keyboard . IsKeyDown ( Key . LeftShift ) )
126+ return ;
165127 this . ViewModel . CommandConnectorDrag . Execute ( ) ;
166128 DataObject data = new DataObject ( ) ;
167129 data . SetData ( "Connector" , this . ViewModel ) ;
168130 DragDrop . DoDragDrop ( this , data , DragDropEffects . Link ) ;
169- this . ViewModel ? . CommandCheckConnectorDrop . Execute ( ) ;
170131 e . Handled = true ;
171132 }
172133
173- private void ConnectorDragOver ( DragEventArgs e )
174- {
175-
176-
177- //if (this.ViewModel.NodesCanvas.ConnectorPreviewForDrop != this.ViewModel)
178- //{
179- // this.ViewModel.Node.Point1 += 0.0001;
180-
181-
182- // return;
183- //}
184- //e.Handled = true;
185- //this.UpdatePosition();
186-
187- //this.ViewModel.CommandConnectorDragOver.Execute();
188-
189-
190-
191- return ;
192- }
193-
194134 private void ConnectorDragEnter ( DragEventArgs e )
195135 {
196136 if ( this . ViewModel . NodesCanvas . ConnectorPreviewForDrop == null )
@@ -203,17 +143,6 @@ private void ConnectorDragEnter(DragEventArgs e)
203143
204144 e . Handled = true ;
205145 }
206-
207- private void ConnectorDragLeave ( DragEventArgs e )
208- {
209- if ( this . ViewModel . NodesCanvas . ConnectorPreviewForDrop != null )
210- return ;
211-
212- this . ViewModel . CommandConnectorDragLeave . Execute ( ) ;
213-
214- e . Handled = true ;
215- }
216-
217146 private void ConnectorDrop ( DragEventArgs e )
218147 {
219148 if ( this . ViewModel . NodesCanvas . ConnectorPreviewForDrop == null )
@@ -237,7 +166,7 @@ void UpdatePositionConnectPoin()
237166 if ( this . IsVisible )
238167 {
239168 // Координата центра
240- positionConnectPoint = Form . TranslatePoint ( new Point ( Form . Width - 1 , Form . Height / 2 ) , this ) ;
169+ positionConnectPoint = Form . TranslatePoint ( new Point ( Form . Width / 2 , Form . Height / 2 ) , this ) ;
241170
242171 //Ищем Canvas
243172 ViewNodesCanvas NodesCanvas = MyUtils . FindParent < ViewNodesCanvas > ( this ) ;
0 commit comments