mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-02 15:50:51 +08:00
Merge branch 'master' of https://gitee.com/akwkevin/aistudio.-wpf.-diagram
This commit is contained in:
@@ -65,6 +65,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
this.ChildFlag = designer.ChildFlag;
|
||||
this.PhysicalItemWidth = designer.PhysicalItemWidth;
|
||||
this.PhysicalItemHeight = designer.PhysicalItemHeight;
|
||||
this.Parameter = new ConstParameter(designer.Parameter);
|
||||
if (designer.Children != null)
|
||||
{
|
||||
foreach (var child in designer.Children)
|
||||
@@ -178,8 +179,8 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
private IParameter _parameter;
|
||||
public IParameter Parameter
|
||||
private ConstParameter _parameter;
|
||||
public ConstParameter Parameter
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -350,5 +351,15 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
base.Dispose();
|
||||
|
||||
foreach (var child in Children)
|
||||
{
|
||||
child.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -814,7 +814,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
BuildMenuOptions();
|
||||
}
|
||||
|
||||
public DiagramViewModel(DiagramItem diagramItem, string ext) : this()
|
||||
public DiagramViewModel(DiagramItem diagramItem, string ext =".json") : this()
|
||||
{
|
||||
Init(diagramItem);
|
||||
|
||||
@@ -849,6 +849,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
public void Init(DiagramItem diagramItem)
|
||||
{
|
||||
DiagramType = diagramItem.DiagramType;
|
||||
Name = diagramItem.Name;
|
||||
DiagramOption.LayoutOption.ShowGrid = diagramItem.ShowGrid;
|
||||
DiagramOption.LayoutOption.PhysicalGridCellSize = diagramItem.PhysicalGridCellSize;
|
||||
DiagramOption.LayoutOption.CellHorizontalAlignment = diagramItem.CellHorizontalAlignment;
|
||||
@@ -858,7 +859,8 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
DiagramOption.LayoutOption.PageSizeType = diagramItem.PageSizeType;
|
||||
DiagramOption.LayoutOption.PhysicalGridMarginSize = diagramItem.PhysicalGridMarginSize;
|
||||
DiagramOption.LayoutOption.GridColor = diagramItem.GridColor;
|
||||
DiagramOption.LayoutOption.AllowDrop = diagramItem.AllowDrop;
|
||||
DiagramOption.LayoutOption.PageBackground = diagramItem.PageBackground;
|
||||
DiagramOption.LayoutOption.AllowDrop = diagramItem.AllowDrop;
|
||||
|
||||
Thumbnail = diagramItem.Thumbnail.ToBrush((int)DiagramOption.LayoutOption.PageSize.Width / 4, (int)DiagramOption.LayoutOption.PageSize.Height / 4);
|
||||
Init(true);
|
||||
|
||||
@@ -530,6 +530,19 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
return null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
base.Dispose();
|
||||
|
||||
if (ParentContainer == null)
|
||||
{
|
||||
foreach (var container in Containers)
|
||||
{
|
||||
container.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region 扩展
|
||||
|
||||
@@ -14,6 +14,11 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
}
|
||||
|
||||
public BlockDiagramViewModel(DiagramItem diagramItem, string ext) : base(diagramItem, ext)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#region
|
||||
private ICommand _addNextCommand;
|
||||
public ICommand AddNextCommand
|
||||
|
||||
Reference in New Issue
Block a user