mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
xx
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AIStudio.Wpf.DiagramDesigner.Models;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
@@ -42,17 +43,36 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
public void AddNext(BlockDesignerItemViewModel next)
|
||||
{
|
||||
this.ParentId = new Guid();
|
||||
this.Parent = null;
|
||||
if (this.Next == next)
|
||||
{
|
||||
AlignNext(next);
|
||||
return;
|
||||
}
|
||||
RemoveNext();
|
||||
|
||||
next.Left = this.Left;
|
||||
next.Top = this.Top + this.GetItemHeight();
|
||||
next.ParentId = this.Id;
|
||||
next.Parent = this;
|
||||
this.Next = next;
|
||||
//if (oldnext != null)
|
||||
//{
|
||||
// next.AddNext(oldnext);
|
||||
//}
|
||||
if (next.Next != null)
|
||||
{
|
||||
next.AlignNext(next.Next);
|
||||
}
|
||||
}
|
||||
|
||||
public void AlignNext(BlockDesignerItemViewModel next)
|
||||
{
|
||||
if (next != null && this.Next == next)
|
||||
{
|
||||
next.Left = this.Left;
|
||||
next.Top = this.Top + this.GetItemHeight();
|
||||
if (next.Next != null)
|
||||
{
|
||||
next.AlignNext(next.Next);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveNext()
|
||||
@@ -100,12 +120,16 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
child.RemoveFromSelection();
|
||||
this.AddToSelection(true, false);
|
||||
|
||||
AlignNext(this.Next);
|
||||
}
|
||||
|
||||
public virtual void RemoveChild(BlockDesignerItemViewModel child)
|
||||
{
|
||||
this.RemoveFromSelection();
|
||||
child.AddToSelection(true, false);
|
||||
|
||||
AlignNext(this.Next);
|
||||
}
|
||||
|
||||
public ObservableCollection<ItemsContainerInfo> Contains
|
||||
|
||||
Reference in New Issue
Block a user