mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-02 23:26:35 +08:00
箭头分离到独立的model中,方便自定义path
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user