Skip to content

Commit c14aacd

Browse files
committed
some fix
1 parent 449ada7 commit c14aacd

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

SimpleStateMachineNodeEditor/View/ViewRightConnector.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private void SetupEvents()
102102
{
103103
this.EllipseElement.Events().MouseLeftButtonDown.Subscribe(e => ConnectDrag(e)).DisposeWith(disposable);
104104
this.TextBoxElement.Events().LostFocus.Subscribe(e => Validate(e)).DisposeWith(disposable);
105-
//this.BorderElement.Events().PreviewMouseLeftButtonDown.Subscribe(e => ConnectorDrag(e)).DisposeWith(disposable);
105+
this.BorderElement.Events().PreviewMouseLeftButtonDown.Subscribe(e => ConnectorDrag(e)).DisposeWith(disposable);
106106
this.BorderElement.Events().PreviewDragEnter.Subscribe(e => ConnectorDragEnter(e)).DisposeWith(disposable);
107107
this.BorderElement.Events().PreviewDrop.Subscribe(e => ConnectorDrop(e)).DisposeWith(disposable);
108108
});

SimpleStateMachineNodeEditor/ViewModel/ViewModelNode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ private void AddConnectorWithConnect((int index, ViewModelConnector connector) e
170170
Transitions.Insert(element.index, element.connector);
171171
if(element.connector.Connect!=null)
172172
{
173-
NodesCanvas.CommandAddConnect.Execute(element.connector.Connect);
173+
NodesCanvas.CommandAddConnect.ExecuteWithSubscribe(element.connector.Connect);
174174
}
175175
}
176176
private void DeleteConnectorWithConnec(ViewModelConnector connector)

SimpleStateMachineNodeEditor/ViewModel/ViewModelNodesCanvas.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ private void SetAsStart(ViewModelNode node)
106106
public ReactiveCommand<Unit,Unit> CommandSelectorIntersect { get; set; }
107107
public ReactiveCommand<Unit,Unit> CommandCutterIntersect { get; set; }
108108

109-
public SimpleCommandWithParameter<ViewModelConnect> CommandAddConnect { get; set; }
109+
110+
//public SimpleCommandWithParameter<ViewModelConnect> CommandAddConnect { get; set; }
111+
public ReactiveCommand<ViewModelConnect, Unit> CommandAddConnect { get; set; }
110112
public SimpleCommandWithParameter<ViewModelConnect> CommandDeleteConnect { get; set; }
111113
//public SimpleCommandWithParameter<(int connectorIndex, ViewModelConnect connect)> CommandAddConnectWithConnector { get; set; }
112114
//public SimpleCommandWithParameter<ViewModelConnect> CommandDeleteConnectWithConnector { get; set; }
@@ -156,7 +158,9 @@ private void SetupCommands()
156158
CommandCutterIntersect = ReactiveCommand.Create(SelectConnects);
157159
CommandValidateNodeName = new SimpleCommandWithParameter<(ViewModelNode objectForValidate, string newValue)>(ValidateNodeName);
158160
CommandValidateConnectName = new SimpleCommandWithParameter<(ViewModelNode objectForValidate, string newValue)>(ValidateConnectName);
159-
CommandAddConnect = new SimpleCommandWithParameter<ViewModelConnect>(AddConnect, NotSaved);
161+
//CommandAddConnect = new SimpleCommandWithParameter<ViewModelConnect>(AddConnect, NotSaved);
162+
163+
CommandAddConnect = ReactiveCommand.Create< ViewModelConnect>(AddConnect);
160164
CommandDeleteConnect = new SimpleCommandWithParameter<ViewModelConnect>(DeleteConnect, NotSaved);
161165

162166
//CommandPartMoveAllNode = new SimpleCommandWithParameter<MyPoint>(PartMoveAllNode);
@@ -195,6 +199,8 @@ private void NotSavedSubscrube()
195199
{
196200
CommandRedo.Subscribe(_=> NotSaved());
197201
CommandUndo.Subscribe(_ => NotSaved());
202+
203+
CommandAddConnect.Subscribe(_ => NotSaved());
198204
}
199205
#endregion Setup Commands
200206

0 commit comments

Comments
 (0)