@@ -107,7 +107,7 @@ private void SetupCommands()
107107 this . BindCommand ( this . ViewModel , x => x . CommandSelectAll , x => x . ItemExpandDown ) . DisposeWith ( disposable ) ;
108108
109109 this . BindCommand ( this . ViewModel , x => x . CommandDeleteSelectedElements , x => x . BindingDeleteSelectedElements ) . DisposeWith ( disposable ) ;
110-
110+ this . BindCommand ( this . ViewModel , x => x . CommandDeleteSelectedElements , x => x . ItemDelete ) . DisposeWith ( disposable ) ;
111111
112112 this . BindCommand ( this . ViewModel , x => x . CommandCollapseUpSelected , x => x . ItemCollapsUp ) . DisposeWith ( disposable ) ;
113113 this . BindCommand ( this . ViewModel , x => x . CommandExpandDownSelected , x => x . ItemExpandDown ) . DisposeWith ( disposable ) ;
@@ -119,6 +119,8 @@ private void SetupCommands()
119119
120120 this . WhenAnyValue ( x => x . ViewModel . JPEGPath ) . Where ( x=> ! string . IsNullOrEmpty ( x ) ) . Subscribe ( value=> SaveCanvasToImage ( value , ImageFormats . JPEG ) ) . DisposeWith ( disposable ) ;
121121
122+
123+
122124 } ) ;
123125 }
124126 #endregion Setup Commands
@@ -131,15 +133,11 @@ private void SetupEvents()
131133 this . Events ( ) . MouseLeftButtonDown . Subscribe ( e => OnEventMouseLeftDown ( e ) ) . DisposeWith ( disposable ) ;
132134 this . Events ( ) . MouseLeftButtonUp . Subscribe ( e => OnEventMouseLeftUp ( e ) ) ;
133135 this . Events ( ) . MouseRightButtonDown . Subscribe ( e => OnEventMouseRightDown ( e ) ) . DisposeWith ( disposable ) ;
134- //this.Events().MouseRightButtonUp.Subscribe(e => OnEventMouseRightUp(e)).DisposeWith(disposable);
135- //this.Events().MouseDown.Subscribe(e => OnEventMouseDown(e)).DisposeWith(disposable);
136136 this . Events ( ) . MouseUp . Subscribe ( e => OnEventMouseUp ( e ) ) . DisposeWith ( disposable ) ;
137137 this . Events ( ) . MouseMove . Subscribe ( e => OnEventMouseMove ( e ) ) . DisposeWith ( disposable ) ;
138138 this . Events ( ) . MouseWheel . Subscribe ( e => OnEventMouseWheel ( e ) ) . DisposeWith ( disposable ) ;
139139 this . Events ( ) . DragOver . Subscribe ( e => OnEventDragOver ( e ) ) . DisposeWith ( disposable ) ;
140- //this.Events().DragEnter.Subscribe(e => OnEventDragEnter(e)).DisposeWith(disposable);
141- //this.Events().DragLeave.Subscribe(e => OnEventDragLeave(e)).DisposeWith(disposable);
142- //Эти события срабатывают раньше команд
140+ this . Cutter . Events ( ) . MouseLeftButtonUp . InvokeCommand ( this . ViewModel . CommandDeleteSelectedConnectors ) . DisposeWith ( disposable ) ;
143141 this . Events ( ) . PreviewMouseLeftButtonDown . Subscribe ( e => OnEventPreviewMouseLeftButtonDown ( e ) ) . DisposeWith ( disposable ) ;
144142 this . Events ( ) . PreviewMouseRightButtonDown . Subscribe ( e => OnEventPreviewMouseRightButtonDown ( e ) ) . DisposeWith ( disposable ) ;
145143 this . WhenAnyValue ( x => x . ViewModel . Scale . Value ) . Subscribe ( value => { this . Canvas . Height /= value ; this . Canvas . Width /= value ; } ) . DisposeWith ( disposable ) ;
@@ -176,12 +174,6 @@ private void OnEventMouseRightDown(MouseButtonEventArgs e)
176174 {
177175 Keyboard . Focus ( this ) ;
178176
179- }
180- private void OnEventMouseRightUp ( MouseButtonEventArgs e )
181- {
182- }
183- private void OnEventMouseDown ( MouseButtonEventArgs e )
184- {
185177 }
186178 private void OnEventMouseWheel ( MouseWheelEventArgs e )
187179 {
@@ -215,10 +207,6 @@ private void OnEventMouseMove(MouseEventArgs e)
215207 ViewModel . CommandPartMoveAllSelectedNode . ExecuteWithSubscribe ( delta ) ;
216208 Move = TypeMove . MoveSelected ;
217209 }
218- }
219- private void OnEventDragEnter ( DragEventArgs e )
220- {
221-
222210 }
223211 private void OnEventDragOver ( DragEventArgs e )
224212 {
@@ -228,10 +216,6 @@ private void OnEventDragOver(DragEventArgs e)
228216 point -= 2 ;
229217 this . ViewModel . DraggedConnect . EndPoint . Set ( point / this . ViewModel . Scale . Value ) ;
230218 }
231- }
232- private void OnEventDragLeave ( DragEventArgs e )
233- {
234-
235219 }
236220 private void OnEventPreviewMouseLeftButtonDown ( MouseButtonEventArgs e )
237221 {
0 commit comments