分离出一个小demo

This commit is contained in:
艾竹
2022-11-30 19:07:40 +08:00
parent 513937c1d6
commit 13f30f23d8
25 changed files with 377 additions and 47 deletions

View File

@@ -6,7 +6,9 @@
xmlns:views="clr-namespace:AIStudio.Wpf.DiagramApp.Views"
xmlns:viewmodels="clr-namespace:AIStudio.Wpf.DiagramApp.ViewModels"
xmlns:model="clr-namespace:AIStudio.Wpf.DiagramApp.Models"
xmlns:dd="https://astudio.github.io/diagram"
xmlns:flowchartmodel="clr-namespace:AIStudio.Wpf.Flowchart.Models;assembly=AIStudio.Wpf.Flowchart"
xmlns:sfcmodel="clr-namespace:AIStudio.Wpf.SFC.Models;assembly=AIStudio.Wpf.SFC"
xmlns:dd="https://gitee.com/akwkevin/aistudio.-wpf.-diagram"
xmlns:conventer="clr-namespace:AIStudio.Wpf.DiagramHelper.Converters;assembly=AIStudio.Wpf.DiagramHelper"
xmlns:command="clr-namespace:AIStudio.Wpf.DiagramHelper.Commands;assembly=AIStudio.Wpf.DiagramHelper"
xmlns:svg="clr-namespace:Svg2XamlTestExtension;assembly=Svg2XamlTestExtension"
@@ -19,7 +21,7 @@
<dd:EnumDescriptionConverter x:Key="EnumDescriptionConverter"/>
<command:CommandReference x:Key="DeleteItemCommandReference" Command="{Binding DeleteItemCommand}"/>
<DataTemplate DataType="{x:Type model:ImageToolBoxData}">
<Grid Width="{Binding Width}" Height="{Binding Height}">
<Rectangle Name="Border"
@@ -159,19 +161,17 @@
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
<DataTemplate DataType="{x:Type model:FlowchartToolBoxData}">
<DataTemplate DataType="{x:Type flowchartmodel:FlowchartToolBoxData}">
<Grid Width="{Binding Width}" Height="{Binding Height}">
<Rectangle Name="Border"
StrokeThickness="1"
StrokeDashArray="2"
Fill="Transparent"
SnapsToDevicePixels="true"/>
<Viewbox Stretch="Fill">
<Grid IsHitTestVisible="False">
<ContentControl Style="{StaticResource CustomFlowNodeStyle}" Margin="2"/>
<TextBlock Text="{Binding Text}" Margin="5" Foreground="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}" HorizontalAlignment="Left" />
</Grid>
</Viewbox>
<Grid IsHitTestVisible="False">
<ContentControl Style="{StaticResource CustomFlowNodeStyle}" Margin="2"/>
<TextBlock Text="{Binding Text}" Margin="5" TextWrapping="WrapWithOverflow" FontSize="9" Foreground="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
</Grid>
<DataTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
@@ -179,7 +179,7 @@
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
<DataTemplate DataType="{x:Type model:SFCToolBoxData}">
<DataTemplate DataType="{x:Type sfcmodel:SFCToolBoxData}">
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Kind,Converter={StaticResource EnumDescriptionConverter}}">
<Rectangle Name="Border"
StrokeThickness="1"
@@ -187,7 +187,7 @@
Fill="Transparent"
SnapsToDevicePixels="true"/>
<Grid IsHitTestVisible="False">
<ContentControl Style="{StaticResource CustomSFCNodeStyle}" Margin="2" />
<ContentControl Style="{StaticResource CustomSFCNodeStyle}" Margin="2" />
</Grid>
</Grid>
<DataTemplate.Triggers>