mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-05 00:37:19 +08:00
mind
This commit is contained in:
84
AIStudio.Wpf.Mind/Models/MindNodeDesignerItem.cs
Normal file
84
AIStudio.Wpf.Mind/Models/MindNodeDesignerItem.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user