diff --git a/AIStudio.Wpf.DiagramApp/ViewModels/MainWindowViewModel.cs b/AIStudio.Wpf.DiagramApp/ViewModels/MainWindowViewModel.cs index b01fb48..61d6244 100644 --- a/AIStudio.Wpf.DiagramApp/ViewModels/MainWindowViewModel.cs +++ b/AIStudio.Wpf.DiagramApp/ViewModels/MainWindowViewModel.cs @@ -29,7 +29,6 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels { ToolBoxViewModel = new ToolBoxViewModel(); - ConnectorViewModel.PathFinder = new OrthogonalPathFinder(); DiagramsViewModels = new ObservableCollection(); DiagramsViewModels.Add(new DiagramsViewModel("新建-1", "*", DiagramType.Normal)); DiagramsViewModel = DiagramsViewModels.FirstOrDefault(); diff --git a/AIStudio.Wpf.DiagramDesigner.Test/MainWindow.xaml b/AIStudio.Wpf.DiagramDesigner.Test/MainWindow.xaml index a684a62..ec43a6c 100644 --- a/AIStudio.Wpf.DiagramDesigner.Test/MainWindow.xaml +++ b/AIStudio.Wpf.DiagramDesigner.Test/MainWindow.xaml @@ -5,6 +5,9 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:AIStudio.Wpf.DiagramDesigner.Test" xmlns:dd="https://gitee.com/akwkevin/aistudio.-wpf.-diagram" + xmlns:controls="clr-namespace:AIStudio.Wpf.DiagramHelper.Controls;assembly=AIStudio.Wpf.DiagramHelper" + xmlns:flowchart="clr-namespace:AIStudio.Wpf.Flowchart;assembly=AIStudio.Wpf.Flowchart" + xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> @@ -32,5 +35,52 @@ + + + #FFE0E0E0 + + + + + + + diff --git a/AIStudio.Wpf.DiagramDesigner.Test/ToolBoxControl.xaml b/AIStudio.Wpf.DiagramDesigner.Test/ToolBoxControl.xaml index 7ff5574..1e924d2 100644 --- a/AIStudio.Wpf.DiagramDesigner.Test/ToolBoxControl.xaml +++ b/AIStudio.Wpf.DiagramDesigner.Test/ToolBoxControl.xaml @@ -43,7 +43,7 @@ - + UpdateConnectionPoints(IDiagramViewModel diagramViewModel, Point sourceA, Point sourceB, FullyCreatedConnectorInfo sourceConnectorInfo, ConnectorInfoBase sinkConnectorInfo) + { + List connectionPoints; + var isFullConnection = sinkConnectorInfo is FullyCreatedConnectorInfo; + + var points = new List() + { + sourceA, + sourceB + }; + + ConnectorInfo sourceInfo = ConnectorInfo(sourceConnectorInfo.Orientation, + points[0].X, + points[0].Y, + sourceConnectorInfo.DataItem.ItemWidth, + sourceConnectorInfo.DataItem.ItemHeight, + points[0]); + + + //StartPoint = points[0]; + if (isFullConnection) + { + + ConnectorInfo sinkInfo = ConnectorInfo(sinkConnectorInfo.Orientation, + points[1].X, + points[1].Y, + ((FullyCreatedConnectorInfo)sinkConnectorInfo).DataItem.ItemWidth, + ((FullyCreatedConnectorInfo)sinkConnectorInfo).DataItem.ItemHeight, + points[1]); + + connectionPoints = PointInfoBase.ToList(GetConnectionLine(diagramViewModel, sourceInfo, sinkInfo, false, sourceConnectorInfo.IsInnerPoint)); + //EndPoint = ConnectionPoints.Last(); + } + else + { + connectionPoints = PointInfoBase.ToList(GetConnectionLine(diagramViewModel, sourceInfo, points[1], sourceConnectorInfo.Orientation, false, sourceConnectorInfo.IsInnerPoint)); + //EndPoint = new Point(); + } + + return connectionPoints; + } + + public ConnectorInfo ConnectorInfo(ConnectorOrientation orientation, double left, double top, double width, double height, Point position) + { + return new ConnectorInfo() + { + Orientation = orientation, + DesignerItemSize = new Size(width, height), + DesignerItemLeft = left, + DesignerItemTop = top, + Position = position + }; + } + + public List GetConnectionLine(IDiagramViewModel diagramViewModel, ConnectorInfo source, ConnectorInfo sink, bool showLastLine, bool sourceInnerPoint = false) + { + var points = new List(); + var ends = new List { source.Position, sink.Position }; + + points.Add(ends[0]); + points.AddRange(GetMiddlePoints(source, sink, diagramViewModel.GridCellSize, diagramViewModel.GridMargin, true)); + points.Add(ends[1]); + var res = points.ToArray(); + DoShift(res); + return res.ToList(); + } + + public List GetConnectionLine(IDiagramViewModel diagramViewModel, ConnectorInfo source, Point sinkPoint, ConnectorOrientation preferredOrientation, bool showLastLine, bool isInnerPoint = false) + { + var points = new List(); + var ends = new List { source.Position, sinkPoint }; + + points.Add(ends[0]); + points.AddRange(GetMiddlePoints(source, new ConnectorInfo() { Orientation = ConnectorOrientation.Top, Position = sinkPoint }, diagramViewModel.GridCellSize, diagramViewModel.GridMargin, false)); + points.Add(ends[1]); + var res = points.ToArray(); + DoShift(res); + return res.ToList(); + } + + private IEnumerable GetMiddlePoints(ConnectorInfo source, ConnectorInfo sink, Size gridCellSize, double gridMargin, bool isFullConnection) + { + var points = new List(); + if (isFullConnection) + { + var p0 = GetFirstSegment(source.Orientation, source.Position, gridCellSize, gridMargin); + var p1 = GetFirstSegment(sink.Orientation, sink.Position, gridCellSize, gridMargin); + + if (p0 == p1) + return points; + + + var p2 = new Point(GetNearestCross(p0.X, p1.X), GetNearestCross(p0.Y, p1.Y)); + var p3 = new Point(GetNearestCross(p1.X, p0.X), GetNearestCross(p1.Y, p0.Y)); + if (p2 == p3) + { + points.Add(p0); + points.Add(p2); + points.Add(p1); + } + else + { + points.Add(p0); + points.Add(p2); + if (!(Math.Abs(p2.X - p3.X) < 0.0001) && !(Math.Abs(p2.Y - p3.Y) < 0.0001)) + points.Add(new Point(p2.X, p3.Y)); + points.Add(p3); + points.Add(p1); + } + DoScale(points, gridCellSize, gridMargin); + } + return points; + } + + private Point GetFirstSegment(ConnectorOrientation orientation, Point point, Size cellSize, double margin) + { + double x = (int)((point.X - margin) / cellSize.Width) + 0.5; + double y = (int)((point.Y - margin) / cellSize.Height) + 0.5; + if (orientation == ConnectorOrientation.Top) + return new Point(x, y - 0.5); + else if (orientation == ConnectorOrientation.Bottom) + return new Point(x, y + 0.5); + else if (orientation == ConnectorOrientation.Left) + return new Point(x - 0.5, y); + else + return new Point(x + 0.5, y); + } + + public static double GetNearestCross(double a, double b) + { + if (Math.Abs(a - b) < 0.0001 && (int)a == a) + return a; + else if (a < b) + return Math.Ceiling(a); + else + return Math.Floor(a); + } + + public static Point SegmentMiddlePoint(Point p1, Point p2) + { + return new Point((p1.X + p2.X) / 2, (p1.Y + p2.Y) / 2); + } + + + private void DoScale(List points, Size cellSize, double margin) + { + for (int i = 0; i < points.Count; i++) + { + points[i] = new Point(points[i].X * cellSize.Width + margin, + points[i].Y * cellSize.Height + margin); + } + } + + private void DoShift(Point[] points) + { + double left = new Point[] { points.FirstOrDefault(), points.LastOrDefault() }.Min(p => p.X); + double top = new Point[] { points.FirstOrDefault(), points.LastOrDefault() }.Min(p => p.Y); + + for (int i = 0; i < points.Length; i++) + { + points[i].X = points[i].X - left; + points[i].Y = points[i].Y - top; + } + } + + + + + } +} diff --git a/AIStudio.Wpf.DiagramDesigner/Helpers/IPathFinder.cs b/AIStudio.Wpf.DiagramDesigner/Helpers/IPathFinder.cs index 499c3c5..3635d4b 100644 --- a/AIStudio.Wpf.DiagramDesigner/Helpers/IPathFinder.cs +++ b/AIStudio.Wpf.DiagramDesigner/Helpers/IPathFinder.cs @@ -8,7 +8,8 @@ namespace AIStudio.Wpf.DiagramDesigner { public interface IPathFinder { - List GetConnectionLine(ConnectorInfo source, ConnectorInfo sink, bool showLastLine, bool sourceInnerPoint = false); - List GetConnectionLine(ConnectorInfo source, Point sinkPoint, ConnectorOrientation preferredOrientation, bool showLastLine, bool isInnerPoint = false); + List UpdateConnectionPoints(IDiagramViewModel diagramViewModel, Point sourceA, Point sourceB, FullyCreatedConnectorInfo sourceConnectorInfo, ConnectorInfoBase sinkConnectorInfo); + List GetConnectionLine(IDiagramViewModel diagramViewModel, ConnectorInfo source, ConnectorInfo sink, bool showLastLine, bool sourceInnerPoint = false); + List GetConnectionLine(IDiagramViewModel diagramViewModel, ConnectorInfo source, Point sinkPoint, ConnectorOrientation preferredOrientation, bool showLastLine, bool isInnerPoint = false); } } diff --git a/AIStudio.Wpf.DiagramDesigner/Helpers/OrthogonalPathFinder.cs b/AIStudio.Wpf.DiagramDesigner/Helpers/OrthogonalPathFinder.cs index 32ddb50..bf248a9 100644 --- a/AIStudio.Wpf.DiagramDesigner/Helpers/OrthogonalPathFinder.cs +++ b/AIStudio.Wpf.DiagramDesigner/Helpers/OrthogonalPathFinder.cs @@ -15,7 +15,61 @@ namespace AIStudio.Wpf.DiagramDesigner { private const int const_margin = 20; - public List GetConnectionLine(ConnectorInfo source, ConnectorInfo sink, bool showLastLine, bool sourceInnerPoint = false) + public List UpdateConnectionPoints(IDiagramViewModel diagramViewModel, Point sourceA, Point sourceB, FullyCreatedConnectorInfo sourceConnectorInfo, ConnectorInfoBase sinkConnectorInfo) + { + List connectionPoints; + var isFullConnection = sinkConnectorInfo is FullyCreatedConnectorInfo; + var area = new Rect(sourceA, sourceB); + + var points = new List() + { + new Point(sourceA.X < sourceB.X ? 0d : area.Width, sourceA.Y < sourceB.Y ? 0d : area.Height ), + new Point(sourceA.X > sourceB.X ? 0d : area.Width, sourceA.Y > sourceB.Y ? 0d : area.Height) + }; + + ConnectorInfo sourceInfo = ConnectorInfo(sourceConnectorInfo.Orientation, + points[0].X, + points[0].Y, + sourceConnectorInfo.DataItem.ItemWidth, + sourceConnectorInfo.DataItem.ItemHeight, + points[0]); + + //StartPoint = points[0]; + if (isFullConnection) + { + + ConnectorInfo sinkInfo = ConnectorInfo(sinkConnectorInfo.Orientation, + points[1].X, + points[1].Y, + ((FullyCreatedConnectorInfo)sinkConnectorInfo).DataItem.ItemWidth, + ((FullyCreatedConnectorInfo)sinkConnectorInfo).DataItem.ItemHeight, + points[1]); + + connectionPoints = PointInfoBase.ToList(GetConnectionLine(diagramViewModel, sourceInfo, sinkInfo, false, sourceConnectorInfo.IsInnerPoint)); + //EndPoint = ConnectionPoints.Last(); + } + else + { + connectionPoints = PointInfoBase.ToList(GetConnectionLine(diagramViewModel, sourceInfo, points[1], sourceConnectorInfo.Orientation, false, sourceConnectorInfo.IsInnerPoint)); + //EndPoint = new Point(); + } + + return connectionPoints; + } + + public ConnectorInfo ConnectorInfo(ConnectorOrientation orientation, double left, double top, double width, double height, Point position) + { + return new ConnectorInfo() + { + Orientation = orientation, + DesignerItemSize = new Size(width, height), + DesignerItemLeft = left, + DesignerItemTop = top, + Position = position + }; + } + + public List GetConnectionLine(IDiagramViewModel diagramViewModel, ConnectorInfo source, ConnectorInfo sink, bool showLastLine, bool sourceInnerPoint = false) { List linePoints = new List(); int margin1 = sourceInnerPoint ? 0 : const_margin; @@ -213,11 +267,11 @@ namespace AIStudio.Wpf.DiagramDesigner return linePoints; } - public List GetConnectionLine(ConnectorInfo source, Point sinkPoint, ConnectorOrientation preferredOrientation, bool showLastLine, bool isInnerPoint = false) + public List GetConnectionLine(IDiagramViewModel diagramViewModel, ConnectorInfo source, Point sinkPoint, ConnectorOrientation preferredOrientation, bool showLastLine, bool isInnerPoint = false) { List linePoints = new List(); - int margin = isInnerPoint ? 0 : const_margin; - + int margin = isInnerPoint ? 0 : const_margin; + Rect rectSource = GetRectWithMargin(source, margin); Point startPoint = GetOffsetPoint(source, rectSource, isInnerPoint); Point endPoint = sinkPoint; diff --git a/AIStudio.Wpf.DiagramDesigner/Helpers/StraightLinePathFinder.cs b/AIStudio.Wpf.DiagramDesigner/Helpers/StraightLinePathFinder.cs new file mode 100644 index 0000000..4476c06 --- /dev/null +++ b/AIStudio.Wpf.DiagramDesigner/Helpers/StraightLinePathFinder.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows; + +namespace AIStudio.Wpf.DiagramDesigner +{ + public class StraightLinePathFinder : IPathFinder + { + + + public List UpdateConnectionPoints(IDiagramViewModel diagramViewModel, Point sourceA, Point sourceB, FullyCreatedConnectorInfo sourceConnectorInfo, ConnectorInfoBase sinkConnectorInfo) + { + var area = new Rect(sourceA, sourceB); + var connectionPoints = PointInfoBase.ToList(new List() + { + + new Point(sourceA.X < sourceB.X ? 0d : area.Width, sourceA.Y < sourceB.Y ? 0d : area.Height ), + new Point(sourceA.X > sourceB.X ? 0d : area.Width, sourceA.Y > sourceB.Y ? 0d : area.Height) + }); + + return connectionPoints; + } + + public List GetConnectionLine(IDiagramViewModel diagramViewModel, ConnectorInfo source, ConnectorInfo sink, bool showLastLine, bool sourceInnerPoint = false) + { + throw new NotImplementedException(); + } + + public List GetConnectionLine(IDiagramViewModel diagramViewModel, ConnectorInfo source, Point sinkPoint, ConnectorOrientation preferredOrientation, bool showLastLine, bool isInnerPoint = false) + { + throw new NotImplementedException(); + } + + + } +} diff --git a/AIStudio.Wpf.DiagramDesigner/ViewModels/ConnectorViewModel.cs b/AIStudio.Wpf.DiagramDesigner/ViewModels/ConnectorViewModel.cs index fb24108..ba117e9 100644 --- a/AIStudio.Wpf.DiagramDesigner/ViewModels/ConnectorViewModel.cs +++ b/AIStudio.Wpf.DiagramDesigner/ViewModels/ConnectorViewModel.cs @@ -15,6 +15,7 @@ namespace AIStudio.Wpf.DiagramDesigner { VectorLineDrawMode = vectorLineDrawMode; Init(sourceConnectorInfo, sinkConnectorInfo); + } public ConnectorViewModel(FullyCreatedConnectorInfo sourceConnectorInfo, ConnectorInfoBase sinkConnectorInfo, DrawMode vectorLineDrawMode) @@ -24,11 +25,17 @@ namespace AIStudio.Wpf.DiagramDesigner } - public static IPathFinder PathFinder { get; set; } + public IPathFinder PathFinder + { + get; set; + } public bool IsFullConnection { - get { return _sinkConnectorInfo is FullyCreatedConnectorInfo; } + get + { + return _sinkConnectorInfo is FullyCreatedConnectorInfo; + } } private Point _sourceA; @@ -127,7 +134,10 @@ namespace AIStudio.Wpf.DiagramDesigner } } - public DrawMode VectorLineDrawMode { get; set; } + public DrawMode VectorLineDrawMode + { + get; set; + } public ConnectorInfo ConnectorInfo(ConnectorOrientation orientation, double left, double top, double width, double height, Point position) { @@ -191,181 +201,11 @@ namespace AIStudio.Wpf.DiagramDesigner private void UpdateConnectionPoints() { - if (VectorLineDrawMode == DrawMode.ConnectingLine) - { - UpdateConnectionPointsByLine(); - } - else if (VectorLineDrawMode == DrawMode.BoundaryConnectingLine) - { - UpdateConnectionPointsByBoundary(); - } - else - { - UpdateConnectionPointsByCorner(); - } - - } - - private void UpdateConnectionPointsByLine() - { - ConnectionPoints = PointInfoBase.ToList(new List() - { - - new Point(SourceA.X < SourceB.X ? 0d : Area.Width, SourceA.Y < SourceB.Y ? 0d : Area.Height ), - new Point(SourceA.X > SourceB.X ? 0d : Area.Width, SourceA.Y > SourceB.Y ? 0d : Area.Height) - }); - StartPoint = ConnectionPoints[0]; + ConnectionPoints = PathFinder.UpdateConnectionPoints(Parent, SourceA, SourceB, SourceConnectorInfo, SinkConnectorInfo); + StartPoint = ConnectionPoints.First(); EndPoint = ConnectionPoints.Last(); - } - private void UpdateConnectionPointsByCorner() - { - var points = new List() - { - - new Point(SourceA.X < SourceB.X ? 0d : Area.Width, SourceA.Y < SourceB.Y ? 0d : Area.Height ), - new Point(SourceA.X > SourceB.X ? 0d : Area.Width, SourceA.Y > SourceB.Y ? 0d : Area.Height) - }; - - ConnectorInfo sourceInfo = ConnectorInfo(SourceConnectorInfo.Orientation, - points[0].X, - points[0].Y, - SourceConnectorInfo.DataItem.ItemWidth, - SourceConnectorInfo.DataItem.ItemHeight, - points[0]); - - StartPoint = points[0]; - if (IsFullConnection) - { - EndPoint = points.Last(); - ConnectorInfo sinkInfo = ConnectorInfo(SinkConnectorInfo.Orientation, - points[1].X, - points[1].Y, - ((FullyCreatedConnectorInfo)_sinkConnectorInfo).DataItem.ItemWidth, - ((FullyCreatedConnectorInfo)_sinkConnectorInfo).DataItem.ItemHeight, - points[1]); - - ConnectionPoints = PointInfoBase.ToList(PathFinder.GetConnectionLine(sourceInfo, sinkInfo, false, SourceConnectorInfo.IsInnerPoint)); - } - else - { - ConnectionPoints = PointInfoBase.ToList(PathFinder.GetConnectionLine(sourceInfo, points[1], SourceConnectorInfo.Orientation, false, SourceConnectorInfo.IsInnerPoint)); - EndPoint = new Point(); - } - } - - #region - private void UpdateConnectionPointsByBoundary() - { - var points = new List(); - var ends = GetEndPoinds(); - - points.Add(ends[0]); - points.AddRange(GetMiddlePoints(ends[0], ends[1])); - points.Add(ends[1]); - var res = points.ToArray(); - //UpdateEdges(res); - DoShift(res); - ConnectionPoints = PointInfoBase.ToList(res.ToList()); - StartPoint = ConnectionPoints[0]; - EndPoint = ConnectionPoints.Last(); - } - - private IEnumerable GetMiddlePoints(Point start, Point end) - { - var points = new List(); - if (IsFullConnection) - { - var p0 = GetFirstSegment(SourceConnectorInfo, start, Parent.GridCellSize, Parent.GridMargin); - var p1 = GetFirstSegment(SinkConnectorInfo, end, Parent.GridCellSize, Parent.GridMargin); - - if (p0 == p1) - return points; - - - var p2 = new Point(GetNearestCross(p0.X, p1.X), GetNearestCross(p0.Y, p1.Y)); - var p3 = new Point(GetNearestCross(p1.X, p0.X), GetNearestCross(p1.Y, p0.Y)); - if (p2 == p3) - { - points.Add(p0); - points.Add(p2); - points.Add(p1); - } - else - { - points.Add(p0); - points.Add(p2); - if (!(Math.Abs(p2.X - p3.X) < 0.0001) && !(Math.Abs(p2.Y - p3.Y) < 0.0001)) - points.Add(new Point(p2.X, p3.Y)); - points.Add(p3); - points.Add(p1); - } - DoScale(points, Parent.GridCellSize, Parent.GridMargin); - } - return points; - } - - private Point[] GetEndPoinds() - { - var linePoints = new Point[2]; - linePoints[0] = SourceA; - linePoints[1] = SourceB; - - return linePoints; - } - - private Point GetFirstSegment(ConnectorInfoBase port, Point point, Size cellSize, double margin) - { - double x = (int)((point.X - margin) / cellSize.Width) + 0.5; - double y = (int)((point.Y - margin) / cellSize.Height) + 0.5; - if (port.Orientation == ConnectorOrientation.Top) - return new Point(x, y - 0.5); - else if (port.Orientation == ConnectorOrientation.Bottom) - return new Point(x, y + 0.5); - else if (port.Orientation == ConnectorOrientation.Left) - return new Point(x - 0.5, y); - else - return new Point(x + 0.5, y); - } - - private double GetNearestCross(double a, double b) - { - if (Math.Abs(a - b) < 0.0001 && (int)a == a) - return a; - else if (a < b) - return Math.Ceiling(a); - else - return Math.Floor(a); - } - - private void DoScale(List points, Size cellSize, double margin) - { - for (int i = 0; i < points.Count; i++) - { - points[i] = new Point(points[i].X * cellSize.Width + margin, - points[i].Y * cellSize.Height + margin); - } - } - - private void DoShift(Point[] points) - { - double left = new Point[] { points.FirstOrDefault(), points.LastOrDefault() }.Min(p => p.X); - double top = new Point[] { points.FirstOrDefault(), points.LastOrDefault() }.Min(p => p.Y); - - for (int i = 0; i < points.Length; i++) - { - points[i].X = points[i].X - left; - points[i].Y = points[i].Y - top; - } - - - } - - private Point SegmentMiddlePoint(Point p1, Point p2) - { - return new Point((p1.X + p2.X) / 2, (p1.Y + p2.Y) / 2); - } - #endregion + } private void ConnectorViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e) { @@ -400,9 +240,20 @@ namespace AIStudio.Wpf.DiagramDesigner private void Init(FullyCreatedConnectorInfo sourceConnectorInfo, ConnectorInfoBase sinkConnectorInfo) { this.Parent = sourceConnectorInfo.DataItem.Parent; + if (VectorLineDrawMode == DrawMode.ConnectingLine) + { + PathFinder = new StraightLinePathFinder(); + } + else if (VectorLineDrawMode == DrawMode.BoundaryConnectingLine) + { + PathFinder = new BoundaryPathFinder(); + } + else + { + PathFinder = new OrthogonalPathFinder(); + } this.SourceConnectorInfo = sourceConnectorInfo; - this.SinkConnectorInfo = sinkConnectorInfo; - PathFinder = new OrthogonalPathFinder(); + this.SinkConnectorInfo = sinkConnectorInfo; DeleteConnectionCommand = new SimpleCommand(DeleteConnection); if (sinkConnectorInfo is FullyCreatedConnectorInfo sink && sink.DataItem.ShowArrow == false) @@ -411,7 +262,10 @@ namespace AIStudio.Wpf.DiagramDesigner } } - public SimpleCommand DeleteConnectionCommand { get; set; } + public SimpleCommand DeleteConnectionCommand + { + get; set; + } private void DeleteConnection(object args) { if (this.Parent is IDiagramViewModel) @@ -439,7 +293,7 @@ namespace AIStudio.Wpf.DiagramDesigner if (diagramVM.DiagramType == DiagramType.FlowChart) { var mid = (int)(ConnectionPoints.Count / 2); - var p = SegmentMiddlePoint(ConnectionPoints[mid - 1], ConnectionPoints[mid]); + var p = BoundaryPathFinder.SegmentMiddlePoint(ConnectionPoints[mid - 1], ConnectionPoints[mid]); textitem.Left = this.Area.Left + p.X + 2; textitem.Top = this.Area.Top + p.Y - 15; } diff --git a/AIStudio.Wpf.DiagramHelper/Controls/Light.Blue.xaml b/AIStudio.Wpf.DiagramHelper/Controls/Light.Blue.xaml new file mode 100644 index 0000000..889b803 --- /dev/null +++ b/AIStudio.Wpf.DiagramHelper/Controls/Light.Blue.xaml @@ -0,0 +1,269 @@ + + + Light.Blue + Fluent.Ribbon + Blue (Light) + Light + Blue + Blue + + #FF0078D7 + + False + + + + + #FF0078D7 + + #CC0078D7 + + #990078D7 + + #660078D7 + + #330078D7 + + #FF086F9E + + + #FF000000 + #51000000 + #FFFFFFFF + #51FFFFFF + #FF333333 + #FF7F7F7F + #FF9D9D9D + #FFA59F93 + #FFB9B9B9 + #FFCCCCCC + #FFD8D8D9 + #FFE0E0E0 + #5EC9C9C9 + #FFF7F7F7 + + #00FFFFFF + #17FFFFFF + + + White + #ADADAD + + + #FFFFD232 + #FFF29536 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file