mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-05-01 13:39:28 +08:00
箭头分离到独立的model中,方便自定义path
This commit is contained in:
@@ -231,9 +231,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="DesignItems\Customs\1.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Images\Svgs\account-book.svg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
@@ -877,6 +874,10 @@
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="DesignItems\Customs\" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
{
|
||||
"Title": null,
|
||||
"DiagramType": 0,
|
||||
"DiagramItems": [
|
||||
{
|
||||
"Name": null,
|
||||
"DiagramType": 0,
|
||||
"DesignerItems": [
|
||||
],
|
||||
"PersistDesignerItems": [
|
||||
],
|
||||
"SettingsDesignerItems": [
|
||||
],
|
||||
"PathDesignerItems": [
|
||||
{
|
||||
"Left": 132.80000000000007,
|
||||
"Top": 101.26000022888184,
|
||||
"ScaleX": 1,
|
||||
"ScaleY": 1,
|
||||
"Margin": 0.0,
|
||||
"ItemWidth": 65.0,
|
||||
"ItemHeight": 65.0,
|
||||
"Icon": "M 0,0 H 60 V 40 C 30,30 30,50 0,40 Z",
|
||||
"ItemTypeName": "AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.ViewModels.PathItemViewModel",
|
||||
"Id": "da395032-ad9e-4dab-a035-f59bed5cb4c4",
|
||||
"ZIndex": 0,
|
||||
"IsGroup": false,
|
||||
"ParentId": "00000000-0000-0000-0000-000000000000",
|
||||
"Text": "欢迎来到AIStudio画板",
|
||||
"ColorItem": {
|
||||
"LineColor": {
|
||||
"BrushType": 1,
|
||||
"Color": "#FF808080",
|
||||
"GradientStop": null,
|
||||
"Offset": null,
|
||||
"Image": null,
|
||||
"SubType": 0,
|
||||
"StartPoint": "0,0",
|
||||
"EndPoint": "0,0",
|
||||
"Opacity": 1.0,
|
||||
"LinearOrientation": 0,
|
||||
"RadialOrientation": 0,
|
||||
"Angle": 0
|
||||
},
|
||||
"FillColor": {
|
||||
"BrushType": 1,
|
||||
"Color": "#FFFFA500",
|
||||
"GradientStop": null,
|
||||
"Offset": null,
|
||||
"Image": null,
|
||||
"SubType": 0,
|
||||
"StartPoint": "0,0",
|
||||
"EndPoint": "0,0",
|
||||
"Opacity": 1.0,
|
||||
"LinearOrientation": 0,
|
||||
"RadialOrientation": 0,
|
||||
"Angle": 0
|
||||
},
|
||||
"ShadowColor": "#00FFFFFF",
|
||||
"LineWidth": 1.0,
|
||||
"LeftArrowPathStyle": 0,
|
||||
"RightArrowPathStyle": 1,
|
||||
"LeftArrowSizeStyle": 10,
|
||||
"RightArrowSizeStyle": 10
|
||||
},
|
||||
"FontItem": {
|
||||
"FontWeight": "Normal",
|
||||
"FontStyle": "Normal",
|
||||
"FontStretch": "Normal",
|
||||
"Underline": false,
|
||||
"Strikethrough": false,
|
||||
"OverLine": false,
|
||||
"FontColor": "#FF000000",
|
||||
"FontFamily": "Arial",
|
||||
"FontSize": 11.0,
|
||||
"FontObject": "Arial, 11pt",
|
||||
"TextEffectColor": "#00FFFFFF",
|
||||
"HighlightColor": "#00FFFFFF",
|
||||
"FontCase": 0,
|
||||
"HorizontalAlignment": 1,
|
||||
"VerticalAlignment": 1,
|
||||
"LineHeight": 0.0
|
||||
}
|
||||
}
|
||||
],
|
||||
"MediaDesignerItems": [
|
||||
],
|
||||
"ImageDesignerItems": [
|
||||
],
|
||||
"TextDesignerItems": [
|
||||
],
|
||||
"LogicalGateItems": [
|
||||
],
|
||||
"FlowNodeDesignerItems": [
|
||||
],
|
||||
"ConnectionIds": [
|
||||
],
|
||||
"Connections": [
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -436,6 +436,17 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public void SetSharp(IShapeViewModel shapeViewModel, string propertyName)
|
||||
{
|
||||
foreach (var item in DiagramViewModel.SelectedItems)
|
||||
{
|
||||
if (item.ShapeViewModel != shapeViewModel)
|
||||
{
|
||||
CopyHelper.CopyPropertyValue(shapeViewModel, item.ShapeViewModel, propertyName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetQuickItem(IQuickThemeViewModel quickThemeViewModel, string propertyName)
|
||||
{
|
||||
if (propertyName == nameof(QuickTheme) && quickThemeViewModel.QuickTheme != null)
|
||||
|
||||
@@ -140,6 +140,13 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
return _service.ColorViewModel;
|
||||
}
|
||||
}
|
||||
public IShapeViewModel ShapeViewModel
|
||||
{
|
||||
get
|
||||
{
|
||||
return _service.ShapeViewModel;
|
||||
}
|
||||
}
|
||||
public IQuickThemeViewModel QuickThemeViewModel
|
||||
{
|
||||
get
|
||||
@@ -677,6 +684,7 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
if (e.PropertyName == nameof(DrawModeViewModel)
|
||||
|| e.PropertyName == nameof(FontViewModel)
|
||||
|| e.PropertyName == nameof(ColorViewModel)
|
||||
|| e.PropertyName == nameof(ShapeViewModel)
|
||||
|| e.PropertyName == nameof(QuickThemeViewModel)
|
||||
|| e.PropertyName == nameof(LockObjectViewModel)
|
||||
|| e.PropertyName == nameof(SelectedItem))
|
||||
@@ -692,6 +700,9 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
if (sender is IColorViewModel)
|
||||
DiagramsViewModel.SetColor(sender as IColorViewModel, e.PropertyName);
|
||||
|
||||
if (sender is IShapeViewModel)
|
||||
DiagramsViewModel.SetSharp(sender as IShapeViewModel, e.PropertyName);
|
||||
|
||||
if (sender is IQuickThemeViewModel)
|
||||
DiagramsViewModel.SetQuickItem(sender as IQuickThemeViewModel, e.PropertyName);
|
||||
|
||||
|
||||
@@ -1141,7 +1141,7 @@
|
||||
<StackPanel>
|
||||
<TextBlock Text="箭头样式" Margin="5"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" helper:EnumHelper.Enum="{x:Type dd:ArrowPathStyle}" SelectedItem="{Binding ColorViewModel.LeftArrowPathStyle}">
|
||||
<Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" helper:EnumHelper.Enum="{x:Type dd:ArrowPathStyle}" SelectedItem="{Binding ShapeViewModel.SourceMarker.PathStyle}">
|
||||
<Fluent:ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<DockPanel>
|
||||
@@ -1167,8 +1167,8 @@
|
||||
</DataTemplate>
|
||||
</Fluent:ComboBox.ItemTemplate>
|
||||
</Fluent:ComboBox>
|
||||
|
||||
<Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" helper:EnumHelper.Enum="{x:Type dd:ArrowPathStyle}" SelectedItem="{Binding ColorViewModel.RightArrowPathStyle}">
|
||||
|
||||
<Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" helper:EnumHelper.Enum="{x:Type dd:ArrowPathStyle}" SelectedItem="{Binding ShapeViewModel.SinkMarker.PathStyle}">
|
||||
<Fluent:ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<DockPanel>
|
||||
@@ -1205,14 +1205,14 @@
|
||||
<StackPanel>
|
||||
<TextBlock Text="箭头样式" Margin="5"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" helper:EnumHelper.Enum="{x:Type dd:ArrowSizeStyle}" SelectedItem="{Binding ColorViewModel.LeftArrowSizeStyle}">
|
||||
<Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" helper:EnumHelper.Enum="{x:Type dd:ArrowSizeStyle}" SelectedItem="{Binding ShapeViewModel.SourceMarker.SizeStyle}">
|
||||
<Fluent:ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" />
|
||||
</DataTemplate>
|
||||
</Fluent:ComboBox.ItemTemplate>
|
||||
</Fluent:ComboBox>
|
||||
<Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" helper:EnumHelper.Enum="{x:Type dd:ArrowSizeStyle}" SelectedItem="{Binding ColorViewModel.RightArrowSizeStyle}">
|
||||
<Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" helper:EnumHelper.Enum="{x:Type dd:ArrowSizeStyle}" SelectedItem="{Binding ShapeViewModel.SinkMarker.SizeStyle}">
|
||||
<Fluent:ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" />
|
||||
|
||||
Reference in New Issue
Block a user