This commit is contained in:
kwai
2023-03-01 19:28:06 +08:00
parent 84d4035e6d
commit 9966656269
17 changed files with 525 additions and 30 deletions

View File

@@ -0,0 +1,84 @@
using System.Windows;
using System.Xml.Serialization;
using AIStudio.Wpf.DiagramDesigner;
using AIStudio.Wpf.Mind.ViewModels;
using Newtonsoft.Json;
namespace AIStudio.Wpf.Mind.Models
{
public class MindNodeDesignerItem : DesignerItemBase
{
public MindNodeDesignerItem()
{
}
public MindNodeDesignerItem(MindNode item) : base(item)
{
NodeLevel = item.NodeLevel;
MindType = item.MindType;
Spacing = item.Spacing;
Offset = item.Offset;
IsExpanded = item.IsExpanded;
}
[XmlAttribute]
public NodeLevel NodeLevel
{
get; set;
}
[XmlAttribute]
public MindType MindType
{
get; set;
}
[XmlIgnore]
public Size Spacing
{
get; set;
}
[JsonIgnore]
[XmlAttribute("Spacing")]
public string XmlSpacing
{
get
{
return SerializeHelper.SerializeSize(Spacing);
}
set
{
Spacing = SerializeHelper.DeserializeSize(value);
}
}
[XmlIgnore]
public Point Offset
{
get; set;
}
[JsonIgnore]
[XmlAttribute("Offset")]
public string XmlOffset
{
get
{
return SerializeHelper.SerializePoint(Offset);
}
set
{
Offset = SerializeHelper.DeserializePoint(value);
}
}
[XmlAttribute]
public bool IsExpanded
{
get; set;
}
}
}