mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-07 02:00:50 +08:00
添加节点可删除
This commit is contained in:
@@ -14,6 +14,8 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
Offset = offset ?? new PointBase();
|
||||
FontViewModel = Parent.FontViewModel;
|
||||
ColorViewModel = Parent.ColorViewModel;
|
||||
|
||||
DeleteLabelCommand = new SimpleCommand(DeleteLabel);
|
||||
}
|
||||
|
||||
public ConnectorViewModel Parent
|
||||
@@ -78,16 +80,11 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
public override PointBase Position
|
||||
public SimpleCommand DeleteLabelCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return new PointBase(Parent.Area.Left + Left, Parent.Area.Top + Top);
|
||||
}
|
||||
get; set;
|
||||
}
|
||||
|
||||
public override PointBase MiddlePosition => new PointBase(Parent.Area.Left + Left + ConnectorWidth / 2, Parent.Area.Top + Top + ConnectorHeight / 2);
|
||||
|
||||
private bool updating = false;
|
||||
|
||||
public void UpdatePosition(SvgPath[] paths)
|
||||
@@ -167,5 +164,13 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
private void DeleteLabel(object parameter)
|
||||
{
|
||||
if (parameter is ConnectorLabelModel label)
|
||||
{
|
||||
Parent.Labels.Remove(label);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user