mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-11 11:46:37 +08:00
bug修复
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using System.Xml;
|
||||
@@ -17,7 +18,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
}
|
||||
|
||||
public DiagramItem(IDiagramViewModel diagramView)
|
||||
public DiagramItem(IDiagramViewModel diagramView, string ext = ".json")
|
||||
{
|
||||
Name = diagramView.Name;
|
||||
DiagramType = diagramView.DiagramType;
|
||||
@@ -30,9 +31,16 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
PageSizeType = diagramView.DiagramOption.LayoutOption.PageSizeType;
|
||||
PhysicalGridMarginSize = diagramView.DiagramOption.LayoutOption.PhysicalGridMarginSize;
|
||||
GridColor = diagramView.DiagramOption.LayoutOption.GridColor;
|
||||
PageBackground = diagramView.DiagramOption.LayoutOption.PageBackground;
|
||||
AllowDrop = diagramView.DiagramOption.LayoutOption.AllowDrop;
|
||||
|
||||
Thumbnail = diagramView.Thumbnail.ToBase64String();
|
||||
|
||||
var selectedDesignerItems = diagramView.Items.OfType<DesignerItemViewModelBase>();
|
||||
var selectedConnections = diagramView.Items.OfType<ConnectionViewModel>();
|
||||
|
||||
DesignerItems = selectedDesignerItems.Select(p => p.ToSerializableItem(ext)).Where(p => p != null).ToList();
|
||||
Connections = selectedConnections.Select(p => p.ToSerializableItem(ext)).Where(p => p != null).ToList();
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
@@ -157,6 +165,26 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public Color PageBackground
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
[XmlAttribute("PageBackground")]
|
||||
public string XmlPageBackground
|
||||
{
|
||||
get
|
||||
{
|
||||
return SerializeHelper.SerializeColor(PageBackground);
|
||||
}
|
||||
set
|
||||
{
|
||||
PageBackground = SerializeHelper.DeserializeColor(value);
|
||||
}
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public bool AllowDrop
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user