|
16 | 16 | using SimpleStateMachineNodeEditor.Helpers; |
17 | 17 | using SimpleStateMachineNodeEditor.ViewModel; |
18 | 18 | using SimpleStateMachineNodeEditor.Helpers.Transformations; |
| 19 | +using SimpleStateMachineNodeEditor.Helpers.Enums; |
19 | 20 |
|
20 | 21 | namespace SimpleStateMachineNodeEditor.View |
21 | 22 | { |
@@ -54,21 +55,22 @@ private void SetupBinding() |
54 | 55 | { |
55 | 56 | Canvas.SetZIndex((UIElement)this.VisualParent, this.ViewModel.Node.Zindex+2); |
56 | 57 |
|
| 58 | + this.OneWayBind(this.ViewModel, x => x.Visible, x => x.RightConnector.Visibility).DisposeWith(disposable); |
| 59 | + |
57 | 60 | this.OneWayBind(this.ViewModel, x => x.Name, x => x.TextBoxElement.Text).DisposeWith(disposable); |
58 | 61 |
|
59 | 62 | this.OneWayBind(this.ViewModel, x => x.TextEnable, x => x.TextBoxElement.IsEnabled).DisposeWith(disposable); |
60 | 63 |
|
61 | | - this.OneWayBind(this.ViewModel, x => x.FormEnable, x => x.EllipseElement.IsEnabled).DisposeWith(disposable); |
| 64 | + this.OneWayBind(this.ViewModel, x => x.Foreground, x => x.TextBoxElement.Foreground).DisposeWith(disposable); |
62 | 65 |
|
| 66 | + this.OneWayBind(this.ViewModel, x => x.FormEnable, x => x.EllipseElement.IsEnabled).DisposeWith(disposable); |
63 | 67 |
|
64 | 68 | this.OneWayBind(this.ViewModel, x => x.FormStroke, x => x.EllipseElement.Stroke).DisposeWith(disposable); |
65 | 69 |
|
66 | 70 | this.OneWayBind(this.ViewModel, x => x.FormStrokeThickness, x => x.EllipseElement.StrokeThickness).DisposeWith(disposable); |
67 | 71 |
|
68 | 72 | this.Bind(this.ViewModel, x => x.FormFill, x => x.EllipseElement.Fill).DisposeWith(disposable); |
69 | 73 |
|
70 | | - this.OneWayBind(this.ViewModel, x => x.Visible, x => x.RightConnector.Visibility).DisposeWith(disposable); |
71 | | - |
72 | 74 | this.WhenAnyValue(x => x.ViewModel.Node.Size, x => x.ViewModel.Node.Point1.Value, x => x.ViewModel.Node.NodesCanvas.Scale.Scales.Value) |
73 | 75 | .Subscribe(_ => { UpdatePositionConnectPoin(); }).DisposeWith(disposable); |
74 | 76 |
|
@@ -122,15 +124,24 @@ private void ConnectDrag(MouseButtonEventArgs e) |
122 | 124 |
|
123 | 125 | private void ConnectorDrag(MouseButtonEventArgs e) |
124 | 126 | { |
125 | | - if (!this.ViewModel.TextEnable) |
126 | | - return; |
127 | | - if (!Keyboard.IsKeyDown(Key.LeftShift)) |
128 | | - return; |
| 127 | + if (!this.ViewModel.TextEnable) |
| 128 | + return; |
| 129 | + if (Keyboard.IsKeyDown(Key.LeftAlt)) |
| 130 | + { |
129 | 131 | this.ViewModel.CommandConnectorDrag.Execute(); |
130 | 132 | DataObject data = new DataObject(); |
131 | 133 | data.SetData("Connector", this.ViewModel); |
132 | 134 | DragDrop.DoDragDrop(this, data, DragDropEffects.Link); |
133 | 135 | e.Handled = true; |
| 136 | + } |
| 137 | + else if (Keyboard.IsKeyDown(Key.LeftAlt)) |
| 138 | + { |
| 139 | + |
| 140 | + } |
| 141 | + else |
| 142 | + { |
| 143 | + this.ViewModel.CommandSelect.Execute(SelectMode.Click); |
| 144 | + } |
134 | 145 |
|
135 | 146 | } |
136 | 147 |
|
|
0 commit comments