diff --git a/AIStudio.Wpf.DiagramDesigner.Additionals/AIStudio.Wpf.DiagramDesigner.Additionals.csproj b/AIStudio.Wpf.DiagramDesigner.Additionals/AIStudio.Wpf.DiagramDesigner.Additionals.csproj
index f9ad509..aa26978 100644
--- a/AIStudio.Wpf.DiagramDesigner.Additionals/AIStudio.Wpf.DiagramDesigner.Additionals.csproj
+++ b/AIStudio.Wpf.DiagramDesigner.Additionals/AIStudio.Wpf.DiagramDesigner.Additionals.csproj
@@ -9,7 +9,7 @@
A.png
- 1.0.1
+ 1.1.7
一个Wpf的Diagram控件帮助库
diff --git a/AIStudio.Wpf.DiagramDesigner/AIStudio.Wpf.DiagramDesigner.csproj b/AIStudio.Wpf.DiagramDesigner/AIStudio.Wpf.DiagramDesigner.csproj
index 07fd8a4..5c56737 100644
--- a/AIStudio.Wpf.DiagramDesigner/AIStudio.Wpf.DiagramDesigner.csproj
+++ b/AIStudio.Wpf.DiagramDesigner/AIStudio.Wpf.DiagramDesigner.csproj
@@ -8,8 +8,7 @@
A.png
- 1.1.5
-
+ 1.1.7
一个Wpf的Diagram控件基础库
diff --git a/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/DiagramViewModel.cs b/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/DiagramViewModel.cs
index 136c5bc..76ce8e5 100644
--- a/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/DiagramViewModel.cs
+++ b/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/DiagramViewModel.cs
@@ -3346,6 +3346,8 @@ namespace AIStudio.Wpf.DiagramDesigner
}
}
}
+
+
#endregion
public override string ToString()
diff --git a/AIStudio.Wpf.DiagramDesigner/ViewModels/DefaultViewModel/BlockDesignerItemTempLink.cs b/AIStudio.Wpf.DiagramDesigner/ViewModels/DefaultViewModel/BlockDesignerItemTempLink.cs
new file mode 100644
index 0000000..3d4690b
--- /dev/null
+++ b/AIStudio.Wpf.DiagramDesigner/ViewModels/DefaultViewModel/BlockDesignerItemTempLink.cs
@@ -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 Items
+ {
+ get;set;
+ } = new List();
+
+ //public static List Build(List blocks)
+ //{
+ // List links = new List(){
+ // new BlockDesignerItemTempLink() };
+
+ // foreach(var )
+ //}
+ }
+}
diff --git a/AIStudio.Wpf.DiagramDesigner/ViewModels/DefaultViewModel/BlockDesignerItemViewModel.cs b/AIStudio.Wpf.DiagramDesigner/ViewModels/DefaultViewModel/BlockDesignerItemViewModel.cs
index 41f9f87..91b41bf 100644
--- a/AIStudio.Wpf.DiagramDesigner/ViewModels/DefaultViewModel/BlockDesignerItemViewModel.cs
+++ b/AIStudio.Wpf.DiagramDesigner/ViewModels/DefaultViewModel/BlockDesignerItemViewModel.cs
@@ -36,16 +36,6 @@ namespace AIStudio.Wpf.DiagramDesigner
IsReadOnlyText = true;
}
- public BlockDesignerItemViewModel Next
- {
- get; set;
- }
-
- public BlockItemsContainerInfo ParentContain
- {
- get; set;
- }
-
public void AddNext(BlockDesignerItemViewModel 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)
{
if (clearother)
@@ -120,11 +97,10 @@ namespace AIStudio.Wpf.DiagramDesigner
IsSelected = selected;
}
-
public virtual void AddChild(BlockDesignerItemViewModel child)
{
child.RemoveFromSelection();
- this.GetRootParent.AddToSelection(true, true);
+ this.GetRootContainItem.AddToSelection(true, true);
System.Windows.Application.Current?.Dispatcher.BeginInvoke(new Action(async () => {
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 Contains
{
get; set;
@@ -155,14 +149,40 @@ namespace AIStudio.Wpf.DiagramDesigner
{
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 GetAllContain()
{
return Contains.SelectMany(p => p.GetAllContain(p.Children, true)).ToList();
}
- public BlockDesignerItemViewModel GetRootParent
+ public BlockDesignerItemViewModel GetRootContainItem
{
get
{
@@ -172,7 +192,7 @@ namespace AIStudio.Wpf.DiagramDesigner
}
else
{
- return ParentContain.DataItem.GetRootParent;
+ return ParentContain.DataItem.GetRootContainItem;
}
}
}
diff --git a/Directory.Build.Props b/Directory.Build.Props
index 44deea0..2eece1a 100644
--- a/Directory.Build.Props
+++ b/Directory.Build.Props
@@ -1,7 +1,7 @@
- net6.0-windows
+ net461;netcoreapp3.1;net5.0-windows;net6.0-windows