mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-06 17:50:51 +08:00
添加节点可删除
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user