箭头分离到独立的model中,方便自定义path

This commit is contained in:
艾竹
2023-01-26 18:27:17 +08:00
parent f11a4170d8
commit 9bb6c6d321
42 changed files with 993 additions and 299 deletions

View File

@@ -34,6 +34,7 @@ namespace AIStudio.Wpf.DiagramDesigner
ColorItem = CopyHelper.Mapper<ColorItem>(viewmodel.ColorViewModel);
FontItem = CopyHelper.Mapper<FontItem, IFontViewModel>(viewmodel.FontViewModel);
SharpItem = CopyHelper.Mapper<SharpItem>(viewmodel.ShapeViewModel);
}
[XmlAttribute]
@@ -76,9 +77,16 @@ namespace AIStudio.Wpf.DiagramDesigner
public FontItem FontItem
{
get; set;
}
}
[XmlElement]
public SharpItem SharpItem
{
get; set;
}
}
[XmlInclude(typeof(ColorItem))]
public class ColorItem : IColorViewModel
{
[XmlIgnore]
@@ -149,46 +157,54 @@ namespace AIStudio.Wpf.DiagramDesigner
}
[XmlAttribute]
public ArrowPathStyle LeftArrowPathStyle
public LineDashStyle LineDashStyle
{
get; set;
}
[XmlAttribute]
public ArrowPathStyle RightArrowPathStyle
{
get; set;
}
public event PropertyChangedEventHandler PropertyChanged;
}
[XmlAttribute]
public ArrowSizeStyle LeftArrowSizeStyle
{
get; set;
}
[XmlAttribute]
public ArrowSizeStyle RightArrowSizeStyle
[XmlInclude(typeof(SharpItem))]
public class SharpItem : IShapeViewModel
{
[XmlIgnore]
public ILinkMarker SourceMarker
{
get; set;
}
[JsonIgnore]
[XmlIgnore]
public double LeftArrowSize
[XmlElement("SourceMarker")]
public LinkMarkerItem XmlSourceMarker
{
get
{
throw new NotImplementedException();
return SourceMarker as LinkMarkerItem;
}
set
{
SourceMarker = value;
}
}
[JsonIgnore]
[XmlIgnore]
public double RightArrowSize
public ILinkMarker SinkMarker
{
get; set;
}
[JsonIgnore]
[XmlElement("SinkMarker")]
public LinkMarkerItem XmlSinkMarker
{
get
{
throw new NotImplementedException();
return SinkMarker as LinkMarkerItem;
}
set
{
SinkMarker = value;
}
}
@@ -734,4 +750,30 @@ namespace AIStudio.Wpf.DiagramDesigner
}
public class LinkMarkerItem : ILinkMarker
{
[XmlAttribute]
public string Path
{
get; set;
}
[XmlAttribute]
public double Width
{
get; set;
}
[XmlAttribute]
public ArrowPathStyle PathStyle
{
get; set;
}
public ArrowSizeStyle SizeStyle
{
get; set;
}
}
}