mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
60 lines
1.7 KiB
C#
60 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using AIStudio.Wpf.DiagramDesigner.Models;
|
|
|
|
namespace AIStudio.Wpf.DiagramDesigner
|
|
{
|
|
public class BlockContainListDesignerItemViewModel : BlockDesignerItemViewModel
|
|
{
|
|
public BlockContainListDesignerItemViewModel()
|
|
{
|
|
}
|
|
|
|
public BlockContainListDesignerItemViewModel(IDiagramViewModel root) : base(root)
|
|
{
|
|
}
|
|
|
|
public BlockContainListDesignerItemViewModel(IDiagramViewModel root, SelectableItemBase designer) : base(root, designer)
|
|
{
|
|
}
|
|
|
|
public BlockContainListDesignerItemViewModel(IDiagramViewModel root, SerializableItem serializableItem, string serializableType) : base(root, serializableItem, serializableType)
|
|
{
|
|
}
|
|
|
|
protected override void InitNew()
|
|
{
|
|
base.InitNew();
|
|
|
|
Containers.Add(new BlockItemsContainerInfo(this.Root, this));
|
|
}
|
|
|
|
public override void AddChild(BlockDesignerItemViewModel child, BlockItemsContainerInfo container)
|
|
{
|
|
if (container == null)
|
|
{
|
|
container = FirstContainer;
|
|
}
|
|
Root.Items.Remove(child);
|
|
container.Children.Add(child);
|
|
|
|
base.AddChild(child, container);
|
|
}
|
|
|
|
public override void RemoveChild(BlockDesignerItemViewModel child, BlockItemsContainerInfo container)
|
|
{
|
|
if (container == null)
|
|
{
|
|
container = FirstContainer;
|
|
}
|
|
Root.Items.Add(child);
|
|
container.Children.Remove(child);
|
|
|
|
base.RemoveChild(child, container);
|
|
}
|
|
}
|
|
}
|