This commit is contained in:
艾竹
2023-06-15 22:44:12 +08:00
parent 207523eb16
commit 1dd09a2240
4 changed files with 65 additions and 14 deletions

View File

@@ -124,7 +124,7 @@ namespace AIStudio.Wpf.DiagramDesigner
public virtual void AddChild(BlockDesignerItemViewModel child)
{
child.RemoveFromSelection();
this.AddToSelection(true, false);
this.GetRootParent.AddToSelection(true, true);
System.Windows.Application.Current?.Dispatcher.BeginInvoke(new Action(async () => {
await Task.Delay(10);
@@ -136,7 +136,8 @@ namespace AIStudio.Wpf.DiagramDesigner
public virtual void RemoveChild(BlockDesignerItemViewModel child)
{
this.RemoveFromSelection();
child.AddToSelection(true, false);
child.AddToSelection(true, true);
System.Windows.Application.Current?.Dispatcher.BeginInvoke(new Action(async () => {
await Task.Delay(10);
@@ -155,6 +156,26 @@ namespace AIStudio.Wpf.DiagramDesigner
{
return Contains?.FirstOrDefault();
}
}
public List<ItemsContainerInfo> GetAllContain()
{
return Contains.SelectMany(p => p.GetAllContain(p.Children, true)).ToList();
}
public BlockDesignerItemViewModel GetRootParent
{
get
{
if (ParentContain == null)
{
return this;
}
else
{
return ParentContain.DataItem.GetRootParent;
}
}
}
}
}