添加节点可删除

This commit is contained in:
艾竹
2023-01-23 15:43:44 +08:00
parent bb2882c618
commit 2c76aacc66
13 changed files with 158 additions and 45 deletions

View File

@@ -61,7 +61,7 @@ namespace AIStudio.Wpf.DiagramDesigner
this.SinkConnectorInfo = sinkConnectorInfo;
DeleteConnectionCommand = new SimpleCommand(DeleteConnection);
AddVertexCommand = new SimpleCommand(AddVertex);
AddTextCommand = new SimpleCommand(AddText);
AddLabelCommand = new SimpleCommand(AddLabel);
}
protected void LoadDesignerItemViewModel(SelectableDesignerItemBase designerbase)
@@ -339,7 +339,7 @@ namespace AIStudio.Wpf.DiagramDesigner
get; set;
}
public SimpleCommand AddTextCommand
public SimpleCommand AddLabelCommand
{
get; set;
}
@@ -643,10 +643,10 @@ namespace AIStudio.Wpf.DiagramDesigner
protected override void ExecuteEditCommand(object param)
{
AddText();
AddLabel();
}
public void AddText(object text = null)
public void AddLabel(object text = null)
{
var label = new ConnectorLabelModel(this, text?.ToString());
label.PropertyChanged += new WeakINPCEventHandler(ConnectorViewModel_PropertyChanged).Handler;
@@ -656,6 +656,8 @@ namespace AIStudio.Wpf.DiagramDesigner
var paths = Labels.Count > 0 ? PathGeneratorResult.Paths.Select(p => new SvgPath(p)).ToArray() : Array.Empty<SvgPath>();
label.UpdatePosition(paths);
}
#endregion
}
}