mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-02 15:50:51 +08:00
init
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<PackageIcon>A.png</PackageIcon>
|
||||
<PackageIconUrl />
|
||||
<NeutralLanguage />
|
||||
<Version>1.0.1</Version>
|
||||
<Version>1.1.7</Version>
|
||||
<Description>一个Wpf的Diagram控件帮助库</Description>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
<PackageIcon>A.png</PackageIcon>
|
||||
<PackageIconUrl />
|
||||
<NeutralLanguage />
|
||||
<Version>1.1.5
|
||||
</Version>
|
||||
<Version>1.1.7</Version>
|
||||
<Description>一个Wpf的Diagram控件基础库</Description>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -3346,6 +3346,8 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
public override string ToString()
|
||||
|
||||
@@ -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 )
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -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<BlockItemsContainerInfo> 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<BlockItemsContainerInfo> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project>
|
||||
<!-- Project properties -->
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
<TargetFrameworks>net461;netcoreapp3.1;net5.0-windows;net6.0-windows</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
||||
Reference in New Issue
Block a user