This commit is contained in:
艾竹
2023-06-17 09:31:15 +08:00
parent bdf7385a39
commit 56545ece4b
6 changed files with 77 additions and 32 deletions

View File

@@ -9,7 +9,7 @@
<PackageIcon>A.png</PackageIcon> <PackageIcon>A.png</PackageIcon>
<PackageIconUrl /> <PackageIconUrl />
<NeutralLanguage /> <NeutralLanguage />
<Version>1.0.1</Version> <Version>1.1.7</Version>
<Description>一个Wpf的Diagram控件帮助库</Description> <Description>一个Wpf的Diagram控件帮助库</Description>
</PropertyGroup> </PropertyGroup>

View File

@@ -8,8 +8,7 @@
<PackageIcon>A.png</PackageIcon> <PackageIcon>A.png</PackageIcon>
<PackageIconUrl /> <PackageIconUrl />
<NeutralLanguage /> <NeutralLanguage />
<Version>1.1.5 <Version>1.1.7</Version>
</Version>
<Description>一个Wpf的Diagram控件基础库</Description> <Description>一个Wpf的Diagram控件基础库</Description>
</PropertyGroup> </PropertyGroup>

View File

@@ -3346,6 +3346,8 @@ namespace AIStudio.Wpf.DiagramDesigner
} }
} }
} }
#endregion #endregion
public override string ToString() public override string ToString()

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AIStudio.Wpf.DiagramDesigner
{
public class BlockDesignerItemTempLink
{
List<BlockDesignerItemViewModel> Items
{
get;set;
} = new List<BlockDesignerItemViewModel>();
//public static List<BlockDesignerItemTempLink> Build(List<BlockDesignerItemViewModel> blocks)
//{
// List<BlockDesignerItemTempLink> links = new List<BlockDesignerItemTempLink>(){
// new BlockDesignerItemTempLink() };
// foreach(var )
//}
}
}

View File

@@ -36,16 +36,6 @@ namespace AIStudio.Wpf.DiagramDesigner
IsReadOnlyText = true; IsReadOnlyText = true;
} }
public BlockDesignerItemViewModel Next
{
get; set;
}
public BlockItemsContainerInfo ParentContain
{
get; set;
}
public void AddNext(BlockDesignerItemViewModel next) public void AddNext(BlockDesignerItemViewModel next)
{ {
if (this.Next == next) if (this.Next == next)
@@ -91,19 +81,6 @@ namespace AIStudio.Wpf.DiagramDesigner
} }
} }
public BlockDesignerItemViewModel GetLastNext()
{
var next = this.Next;
if (next != null)
{
while (next.Next != null)
{
next = next.Next;
}
}
return next;
}
public override void AddToSelection(bool selected, bool clearother) public override void AddToSelection(bool selected, bool clearother)
{ {
if (clearother) if (clearother)
@@ -120,11 +97,10 @@ namespace AIStudio.Wpf.DiagramDesigner
IsSelected = selected; IsSelected = selected;
} }
public virtual void AddChild(BlockDesignerItemViewModel child) public virtual void AddChild(BlockDesignerItemViewModel child)
{ {
child.RemoveFromSelection(); child.RemoveFromSelection();
this.GetRootParent.AddToSelection(true, true); this.GetRootContainItem.AddToSelection(true, true);
System.Windows.Application.Current?.Dispatcher.BeginInvoke(new Action(async () => { System.Windows.Application.Current?.Dispatcher.BeginInvoke(new Action(async () => {
await Task.Delay(10); await Task.Delay(10);
@@ -144,6 +120,24 @@ namespace AIStudio.Wpf.DiagramDesigner
})); }));
} }
public BlockDesignerItemViewModel Prev
{
get
{
return Parent as BlockDesignerItemViewModel;
}
}
public BlockDesignerItemViewModel Next
{
get; set;
}
public BlockItemsContainerInfo ParentContain
{
get; set;
}
public ObservableCollection<BlockItemsContainerInfo> Contains public ObservableCollection<BlockItemsContainerInfo> Contains
{ {
get; set; get; set;
@@ -155,14 +149,40 @@ namespace AIStudio.Wpf.DiagramDesigner
{ {
return Contains?.FirstOrDefault(); return Contains?.FirstOrDefault();
} }
} }
public BlockDesignerItemViewModel GetFirst()
{
var parent = this.Next;
if (parent != null)
{
while (parent.Parent != null)
{
parent = parent.Parent as BlockDesignerItemViewModel;
}
}
return parent;
}
public BlockDesignerItemViewModel GetLast()
{
var next = this;
if (next != null)
{
while (next.Next != null)
{
next = next.Next;
}
}
return next;
}
public List<BlockItemsContainerInfo> GetAllContain() public List<BlockItemsContainerInfo> GetAllContain()
{ {
return Contains.SelectMany(p => p.GetAllContain(p.Children, true)).ToList(); return Contains.SelectMany(p => p.GetAllContain(p.Children, true)).ToList();
} }
public BlockDesignerItemViewModel GetRootParent public BlockDesignerItemViewModel GetRootContainItem
{ {
get get
{ {
@@ -172,7 +192,7 @@ namespace AIStudio.Wpf.DiagramDesigner
} }
else else
{ {
return ParentContain.DataItem.GetRootParent; return ParentContain.DataItem.GetRootContainItem;
} }
} }
} }

View File

@@ -1,7 +1,7 @@
<Project> <Project>
<!-- Project properties --> <!-- Project properties -->
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net6.0-windows</TargetFrameworks> <TargetFrameworks>net461;netcoreapp3.1;net5.0-windows;net6.0-windows</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">