mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-05-03 22:41:30 +08:00
整理了下代码,摸一摸bug
This commit is contained in:
@@ -264,6 +264,9 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<None Update="Images\Gifs\car_chase.gif">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
<None Update="Images\Svgs\account-book.svg">
|
<None Update="Images\Svgs\account-book.svg">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 4.5 MiB After Width: | Height: | Size: 4.5 MiB |
@@ -42,13 +42,13 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
|||||||
DesignerItemViewModelBase start = new StartFlowNode() { Left = 100, Top = 0, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString() };
|
DesignerItemViewModelBase start = new StartFlowNode() { Left = 100, Top = 0, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString() };
|
||||||
DiagramViewModel.Add(start);
|
DiagramViewModel.Add(start);
|
||||||
|
|
||||||
DesignerItemViewModelBase middle1 = new MiddleFlowNode() { Left = 100, Top = 100, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString(), Text = "主管审批", UserIds= new List<string> { "操作员1", "操作员2" }, ActType = "or", SimulateApprove = true };
|
DesignerItemViewModelBase middle1 = new MiddleFlowNode() { Left = 100, Top = 100, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString(), Text = "主管审批(两人或)", UserIds= new List<string> { "操作员1", "操作员2" }, ActType = "or", SimulateApprove = true };
|
||||||
DiagramViewModel.Add(middle1);
|
DiagramViewModel.Add(middle1);
|
||||||
|
|
||||||
DesignerItemViewModelBase decide = new DecideFlowNode() { Left = 100, Top = 200, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString(), Text = "5" };
|
DesignerItemViewModelBase decide = new DecideFlowNode() { Left = 100, Top = 200, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString(), Text = "5" };
|
||||||
DiagramViewModel.Add(decide);
|
DiagramViewModel.Add(decide);
|
||||||
|
|
||||||
DesignerItemViewModelBase middle2 = new MiddleFlowNode() { Left = 200, Top = 300, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString(), Text = "分管领导", UserIds = new List<string> { "操作员1", "操作员2" }, ActType = "and", SimulateApprove = true };
|
DesignerItemViewModelBase middle2 = new MiddleFlowNode() { Left = 200, Top = 300, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString(), Text = "分管领导(两人与)", UserIds = new List<string> { "操作员1", "操作员2" }, ActType = "and", SimulateApprove = true };
|
||||||
DiagramViewModel.Add(middle2);
|
DiagramViewModel.Add(middle2);
|
||||||
|
|
||||||
DesignerItemViewModelBase cobegin = new COBeginFlowNode() { Left = 100, Top = 400, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString() };
|
DesignerItemViewModelBase cobegin = new COBeginFlowNode() { Left = 100, Top = 400, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString() };
|
||||||
@@ -101,7 +101,7 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
|||||||
TextDesignerItemViewModel despcription = new TextDesignerItemViewModel()
|
TextDesignerItemViewModel despcription = new TextDesignerItemViewModel()
|
||||||
{
|
{
|
||||||
Name = nameof(despcription),
|
Name = nameof(despcription),
|
||||||
Left = 260,
|
Left = 360,
|
||||||
Top = 60,
|
Top = 60,
|
||||||
ItemWidth = 300,
|
ItemWidth = 300,
|
||||||
ItemHeight = 150,
|
ItemHeight = 150,
|
||||||
|
|||||||
@@ -13,6 +13,12 @@
|
|||||||
<Description>一个Wpf的Diagram控件帮助库</Description>
|
<Description>一个Wpf的Diagram控件帮助库</Description>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="Images\Bold.png" />
|
||||||
|
<None Remove="Images\Italic.png" />
|
||||||
|
<None Remove="Images\Underline.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Fluent.Ribbon" Version="8.0.3" />
|
<PackageReference Include="Fluent.Ribbon" Version="8.0.3" />
|
||||||
<PackageReference Include="MahApps.Metro.IconPacks" Version="4.8.0" />
|
<PackageReference Include="MahApps.Metro.IconPacks" Version="4.8.0" />
|
||||||
@@ -32,4 +38,10 @@
|
|||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Images\Bold.png" />
|
||||||
|
<Resource Include="Images\Italic.png" />
|
||||||
|
<Resource Include="Images\Underline.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
BIN
AIStudio.Wpf.DiagramDesigner.Additionals/Images/Bold.png
Normal file
BIN
AIStudio.Wpf.DiagramDesigner.Additionals/Images/Bold.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
BIN
AIStudio.Wpf.DiagramDesigner.Additionals/Images/Italic.png
Normal file
BIN
AIStudio.Wpf.DiagramDesigner.Additionals/Images/Italic.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
BIN
AIStudio.Wpf.DiagramDesigner.Additionals/Images/Underline.png
Normal file
BIN
AIStudio.Wpf.DiagramDesigner.Additionals/Images/Underline.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
@@ -47,12 +47,6 @@
|
|||||||
<Resource Include="Images\FormatPainter.cur" />
|
<Resource Include="Images\FormatPainter.cur" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Update="Images\Gifs\car_chase.gif">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Page Update="Controls\MultiSelectComboBox.xaml">
|
<Page Update="Controls\MultiSelectComboBox.xaml">
|
||||||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
|
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
|
||||||
|
|||||||
@@ -43,5 +43,18 @@ namespace AIStudio.Wpf.DiagramDesigner
|
|||||||
ColorViewModel.LineColor.Color = Colors.Transparent;
|
ColorViewModel.LineColor.Color = Colors.Transparent;
|
||||||
ColorViewModel.FillColor.Color = Colors.Transparent;
|
ColorViewModel.FillColor.Color = Colors.Transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public override bool CanAttachTo(ConnectorInfoBase port)
|
||||||
|
{
|
||||||
|
if (port is BlockConnectorInfo blockConnectorInfo)
|
||||||
|
{
|
||||||
|
return port != this && !port.IsReadOnly && DataItem != blockConnectorInfo.DataItem;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1187,7 +1187,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
|||||||
}
|
}
|
||||||
else if (parameter is IEnumerable<SelectableDesignerItemViewModelBase> items)
|
else if (parameter is IEnumerable<SelectableDesignerItemViewModelBase> items)
|
||||||
{
|
{
|
||||||
if (items.Select(p => AddVerify(p)).Any() != true) return;
|
if (items.Select(p => AddVerify(p)).ToList().Any() != true) return;
|
||||||
|
|
||||||
foreach (var item in items)
|
foreach (var item in items)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
|||||||
get { return _suffix; }
|
get { return _suffix; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
SetProperty(ref _suffix, filter.Contains(value) ? value : ".txt");
|
SetProperty(ref _suffix, value != null && filter.Contains(value) ? value : ".txt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,8 +167,10 @@ namespace AIStudio.Wpf.DiagramDesigner
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
System.Diagnostics.Process.Start(Icon);
|
if (!string.IsNullOrEmpty(Icon))
|
||||||
|
{
|
||||||
|
System.Diagnostics.Process.Start(Icon);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InitWidthAndHeight()
|
public void InitWidthAndHeight()
|
||||||
|
|||||||
@@ -41,11 +41,14 @@ namespace AIStudio.Wpf.DiagramDesigner
|
|||||||
if (IsFinish)
|
if (IsFinish)
|
||||||
{
|
{
|
||||||
var path = GetPath();
|
var path = GetPath();
|
||||||
|
var rect = new Rect(Points[0], Points[1]);
|
||||||
|
var point0 = rect.TopLeft;
|
||||||
|
var point1 = rect.BottomRight;
|
||||||
PathGeometry pathGeometry = PathGeometry.CreateFromGeometry(Geometry.Parse(path));
|
PathGeometry pathGeometry = PathGeometry.CreateFromGeometry(Geometry.Parse(path));
|
||||||
var transformGroup = new TransformGroup();
|
var transformGroup = new TransformGroup();
|
||||||
double radiox = Math.Abs(Points[1].X - Points[0].X) / pathGeometry.Bounds.Width;
|
double radiox = Math.Abs(point1.X - point0.X) / pathGeometry.Bounds.Width;
|
||||||
double radioy = Math.Abs(Points[1].Y - Points[0].Y) / pathGeometry.Bounds.Height;
|
double radioy = Math.Abs(point1.Y - point0.Y) / pathGeometry.Bounds.Height;
|
||||||
transformGroup.Children.Add(new TranslateTransform((Points[0].X) / radiox - pathGeometry.Bounds.Left, (Points[0].Y) / radioy - pathGeometry.Bounds.Top));
|
transformGroup.Children.Add(new TranslateTransform((point0.X) / radiox - pathGeometry.Bounds.Left, (point0.Y) / radioy - pathGeometry.Bounds.Top));
|
||||||
transformGroup.Children.Add(new ScaleTransform(radiox, radioy));
|
transformGroup.Children.Add(new ScaleTransform(radiox, radioy));
|
||||||
pathGeometry.Transform = transformGroup;
|
pathGeometry.Transform = transformGroup;
|
||||||
Geometry = pathGeometry;
|
Geometry = pathGeometry;
|
||||||
@@ -85,11 +88,15 @@ namespace AIStudio.Wpf.DiagramDesigner
|
|||||||
}
|
}
|
||||||
|
|
||||||
var path = GetPath();
|
var path = GetPath();
|
||||||
|
var rect = new Rect(Points[0], Points[1]);
|
||||||
|
var point0 = rect.TopLeft;
|
||||||
|
var point1 = rect.BottomRight;
|
||||||
|
|
||||||
PathGeometry pathGeometry = PathGeometry.CreateFromGeometry(Geometry.Parse(path));
|
PathGeometry pathGeometry = PathGeometry.CreateFromGeometry(Geometry.Parse(path));
|
||||||
var transformGroup = new TransformGroup();
|
var transformGroup = new TransformGroup();
|
||||||
double radiox = Math.Abs(point.X - Points[0].X) / pathGeometry.Bounds.Width;
|
double radiox = Math.Abs(point1.X - point0.X) / pathGeometry.Bounds.Width;
|
||||||
double radioy = Math.Abs(point.Y - Points[0].Y) / pathGeometry.Bounds.Height;
|
double radioy = Math.Abs(point1.Y - point0.Y) / pathGeometry.Bounds.Height;
|
||||||
transformGroup.Children.Add(new TranslateTransform((Points[0].X) / radiox - pathGeometry.Bounds.Left, (Points[0].Y) / radioy - pathGeometry.Bounds.Top));
|
transformGroup.Children.Add(new TranslateTransform((point0.X) / radiox - pathGeometry.Bounds.Left, (point0.Y) / radioy - pathGeometry.Bounds.Top));
|
||||||
transformGroup.Children.Add(new ScaleTransform(radiox, radioy));
|
transformGroup.Children.Add(new ScaleTransform(radiox, radioy));
|
||||||
pathGeometry.Transform = transformGroup;
|
pathGeometry.Transform = transformGroup;
|
||||||
Geometry = pathGeometry;
|
Geometry = pathGeometry;
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace AIStudio.Wpf.Flowchart.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private string _remark;
|
private string _remark = "同意";
|
||||||
public string Remark
|
public string Remark
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|||||||
Reference in New Issue
Block a user