mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-04 00:35:46 +08:00
暂时存一版
This commit is contained in:
@@ -30,7 +30,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
else
|
||||
{
|
||||
RaisePropertyChanged(nameof(SourceMarker));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,10 +77,10 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
public class LinkMarker : BindableBase, ILinkMarker
|
||||
{
|
||||
public static LinkMarker None { get; } = new LinkMarker("", 10, ArrowPathStyle.None, ArrowSizeStyle.Middle);
|
||||
public static LinkMarker Arrow { get; } = new LinkMarker("M 0 -5 10 0 0 5 z", 10, ArrowPathStyle.Arrow, ArrowSizeStyle.Middle);
|
||||
public static LinkMarker Circle { get; } = new LinkMarker("M 0, 0 a 5,5 0 1,0 10,0 a 5,5 0 1,0 -10,0", 10, ArrowPathStyle.Circle, ArrowSizeStyle.Middle);
|
||||
public static LinkMarker Square { get; } = new LinkMarker("M 0 -5 10 -5 10 5 0 5 z", 10, ArrowPathStyle.Square, ArrowSizeStyle.Middle);
|
||||
public static LinkMarker None { get; } = new LinkMarker("", 10, 10, ArrowPathStyle.None, ArrowSizeStyle.Middle);
|
||||
public static LinkMarker Arrow { get; } = new LinkMarker("M 0 -5 10 0 0 5 z", 10, 10, ArrowPathStyle.Arrow, ArrowSizeStyle.Middle);
|
||||
public static LinkMarker Circle { get; } = new LinkMarker("M 0, 0 a 5,5 0 1,0 10,0 a 5,5 0 1,0 -10,0", 10, 10, ArrowPathStyle.Circle, ArrowSizeStyle.Middle);
|
||||
public static LinkMarker Square { get; } = new LinkMarker("M 0 -5 10 -5 10 5 0 5 z", 10, 10, ArrowPathStyle.Square, ArrowSizeStyle.Middle);
|
||||
|
||||
public static readonly Dictionary<ArrowPathStyle, string> ArrowDictionary = new Dictionary<ArrowPathStyle, string>()
|
||||
{
|
||||
@@ -95,10 +95,11 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
}
|
||||
|
||||
public LinkMarker(string path, double width, ArrowPathStyle arrowPathStyle, ArrowSizeStyle arrowSizeStyle)
|
||||
public LinkMarker(string path, double width, double height, ArrowPathStyle arrowPathStyle, ArrowSizeStyle arrowSizeStyle)
|
||||
{
|
||||
Path = path;
|
||||
Width = width;
|
||||
Height = height;
|
||||
_pathStyle = arrowPathStyle;
|
||||
_sizeStyle = arrowSizeStyle;
|
||||
}
|
||||
@@ -112,7 +113,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _path, value);
|
||||
SetProperty(ref _path, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,6 +130,19 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
private double _height;
|
||||
public double Height
|
||||
{
|
||||
get
|
||||
{
|
||||
return _height;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _height, value);
|
||||
}
|
||||
}
|
||||
|
||||
private ArrowPathStyle _pathStyle = ArrowPathStyle.None;
|
||||
public ArrowPathStyle PathStyle
|
||||
{
|
||||
@@ -165,13 +179,13 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
|
||||
public static LinkMarker NewArrow(double width, double height)
|
||||
=> new LinkMarker(FormattableString.Invariant($"M 0 -{height / 2} {width} 0 0 {height / 2}"), width, ArrowPathStyle.Arrow, (ArrowSizeStyle)width);
|
||||
=> new LinkMarker(FormattableString.Invariant($"M 0 -{height / 2} {width} 0 0 {height / 2}"), width, height, ArrowPathStyle.Arrow, (ArrowSizeStyle)width);
|
||||
|
||||
public static LinkMarker NewCircle(double r)
|
||||
=> new LinkMarker(FormattableString.Invariant($"M 0, 0 a {r},{r} 0 1,0 {r * 2},0 a {r},{r} 0 1,0 -{r * 2},0"), r * 2, ArrowPathStyle.Circle, (ArrowSizeStyle)(r * 2));
|
||||
=> new LinkMarker(FormattableString.Invariant($"M 0, 0 a {r},{r} 0 1,0 {r * 2},0 a {r},{r} 0 1,0 -{r * 2},0"), r * 2, r * 2, ArrowPathStyle.Circle, (ArrowSizeStyle)(r * 2));
|
||||
|
||||
public static LinkMarker NewRectangle(double width, double height)
|
||||
=> new LinkMarker(FormattableString.Invariant($"M 0 -{height / 2} {width} -{height / 2} {width} {height / 2} 0 {height / 2} z"), width, ArrowPathStyle.Square, (ArrowSizeStyle)width);
|
||||
=> new LinkMarker(FormattableString.Invariant($"M 0 -{height / 2} {width} -{height / 2} {width} {height / 2} 0 {height / 2} z"), width, height, ArrowPathStyle.Square, (ArrowSizeStyle)width);
|
||||
|
||||
public static LinkMarker NewSquare(double size) => NewRectangle(size, size);
|
||||
}
|
||||
@@ -188,6 +202,11 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
get; set;
|
||||
}
|
||||
|
||||
double Height
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
ArrowPathStyle PathStyle
|
||||
{
|
||||
get; set;
|
||||
|
||||
Reference in New Issue
Block a user