暂存一下

This commit is contained in:
艾竹
2023-03-11 12:40:44 +08:00
parent 5cfb32bb19
commit 84f413320f
18 changed files with 763 additions and 144 deletions

View File

@@ -1,7 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dd="https://gitee.com/akwkevin/aistudio.-wpf.-diagram"
xmlns:viewmodel="clr-namespace:AIStudio.Wpf.Mind.ViewModels">
xmlns:viewmodel="clr-namespace:AIStudio.Wpf.Mind.ViewModels"
xmlns:controls="clr-namespace:AIStudio.Wpf.Mind.Controls">
<dd:ColorBrushConverter x:Key="ColorBrushConverter"/>
<dd:DoubleToCornerRadius x:Key="DoubleToCornerRadius"/>
@@ -38,7 +39,7 @@
</Style>
<ControlTemplate x:Key="MindNodeLevelStyle" TargetType="{x:Type ContentControl}">
<Grid>
<Grid>
<Grid.ContextMenu>
<ContextMenu ItemsSource="{Binding MenuOptions}">
<ContextMenu.ItemContainerStyle>
@@ -53,12 +54,36 @@
</Style>
</ContextMenu.ItemContainerStyle>
</ContextMenu>
</Grid.ContextMenu>
<Grid IsHitTestVisible="False">
</Grid.ContextMenu>
<Grid IsHitTestVisible="False">
<Border BorderThickness="{Binding BorderThickness}"
BorderBrush="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}"
Background="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}"
CornerRadius="{Binding CornerRadius}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Image x:Name="image" Source="{Binding Icon}" Stretch="Fill" Width="64" Height="64" Visibility="Collapsed"/>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<controls:RateControl Grid.Column="0" />
<controls:PriorityControl Grid.Column="1"/>
<dd:TextControl Grid.Column="2"/>
<controls:LinkControl Grid.Column="3"/>
<controls:RemarkControl Grid.Column="4"/>
<controls:TagControl Grid.Column="5"/>
</Grid>
</Grid>
</Border>
</Grid>
<ToggleButton x:Name="toggle" IsChecked="{Binding IsExpanded}" Style="{StaticResource ExpandCollapseToggleStyle}" HorizontalAlignment="Left" Margin="-15,0,0,0" Visibility="{Binding Children.Count,Converter={StaticResource IntToVisibilityConverter}}"/>
@@ -78,125 +103,9 @@
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="MindLevel1NodeStyle" TargetType="{x:Type ContentControl}">
<Grid >
<Grid.ContextMenu>
<ContextMenu ItemsSource="{Binding MenuOptions}">
<ContextMenu.ItemContainerStyle>
<Style TargetType="MenuItem">
<Setter Property="MenuItem.Header" Value="{Binding Text}" />
<Setter Property="MenuItem.ItemsSource" Value="{Binding Children}" />
<Setter Property="MenuItem.Command" Value="{Binding Command}" />
<Setter Property="MenuItem.Icon" Value="{Binding Icon}" />
<Setter Property="CommandParameter" Value="{Binding CommandParameter}" />
<Setter Property="MenuItem.IsCheckable" Value="{Binding IsCheckable}" />
<Setter Property="MenuItem.IsChecked" Value="{Binding IsChecked}" />
</Style>
</ContextMenu.ItemContainerStyle>
</ContextMenu>
</Grid.ContextMenu>
<Grid IsHitTestVisible="False">
<Border BorderThickness="{Binding BorderThickness}"
BorderBrush="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}"
Background="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}"
CornerRadius="{Binding CornerRadius}">
</Border>
</Grid>
</Grid>
</ControlTemplate>
<ControlTemplate x:Key="MindLevel2NodeStyle" TargetType="{x:Type ContentControl}">
<Grid>
<Grid.ContextMenu>
<ContextMenu ItemsSource="{Binding MenuOptions}">
<ContextMenu.ItemContainerStyle>
<Style TargetType="MenuItem">
<Setter Property="MenuItem.Header" Value="{Binding Text}" />
<Setter Property="MenuItem.ItemsSource" Value="{Binding Children}" />
<Setter Property="MenuItem.Command" Value="{Binding Command}" />
<Setter Property="MenuItem.Icon" Value="{Binding Icon}" />
<Setter Property="CommandParameter" Value="{Binding CommandParameter}" />
<Setter Property="MenuItem.IsCheckable" Value="{Binding IsCheckable}" />
<Setter Property="MenuItem.IsChecked" Value="{Binding IsChecked}" />
</Style>
</ContextMenu.ItemContainerStyle>
</ContextMenu>
</Grid.ContextMenu>
<Grid IsHitTestVisible="False">
<Border BorderThickness="{Binding BorderThickness}"
BorderBrush="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}"
Background="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}"
CornerRadius="{Binding CornerRadius}">
</Border>
</Grid>
<ToggleButton x:Name="toggle" IsChecked="{Binding IsExpanded}" Style="{StaticResource ExpandCollapseToggleStyle}" HorizontalAlignment="Left" Margin="-15,0,0,0" Visibility="{Binding Children.Count,Converter={StaticResource IntToVisibilityConverter}}"/>
</Grid>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding ConnectorOrientation}" Value="Right">
<Setter TargetName="toggle" Property="HorizontalAlignment" Value="Right"/>
<Setter TargetName="toggle" Property="Margin" Value="0,0,-15,0"/>
</DataTrigger>
<DataTrigger Binding="{Binding ConnectorOrientation}" Value="Top">
<Setter TargetName="toggle" Property="HorizontalAlignment" Value="Center"/>
<Setter TargetName="toggle" Property="VerticalAlignment" Value="Top"/>
<Setter TargetName="toggle" Property="Margin" Value="0,-15,0,0"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="MindLevel3NodeStyle" TargetType="{x:Type ContentControl}">
<Grid>
<Grid.ContextMenu>
<ContextMenu ItemsSource="{Binding MenuOptions}">
<ContextMenu.ItemContainerStyle>
<Style TargetType="MenuItem">
<Setter Property="MenuItem.Header" Value="{Binding Text}" />
<Setter Property="MenuItem.ItemsSource" Value="{Binding Children}" />
<Setter Property="MenuItem.Command" Value="{Binding Command}" />
<Setter Property="MenuItem.Icon" Value="{Binding Icon}" />
<Setter Property="CommandParameter" Value="{Binding CommandParameter}" />
<Setter Property="MenuItem.IsCheckable" Value="{Binding IsCheckable}" />
<Setter Property="MenuItem.IsChecked" Value="{Binding IsChecked}" />
</Style>
</ContextMenu.ItemContainerStyle>
</ContextMenu>
</Grid.ContextMenu>
<Grid IsHitTestVisible="False">
<Border BorderThickness="{Binding BorderThickness}"
BorderBrush="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}"
Background="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}"
CornerRadius="{Binding CornerRadius}">
</Border>
</Grid>
<ToggleButton x:Name="toggle" IsChecked="{Binding IsExpanded}" Style="{StaticResource ExpandCollapseToggleStyle}" HorizontalAlignment="Left" Margin="-15,0,0,0" Visibility="{Binding Children.Count,Converter={StaticResource IntToVisibilityConverter}}"/>
</Grid>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding ConnectorOrientation}" Value="Right">
<Setter TargetName="toggle" Property="HorizontalAlignment" Value="Right"/>
<Setter TargetName="toggle" Property="Margin" Value="0,0,-15,0"/>
</DataTrigger>
<DataTrigger Binding="{Binding ConnectorOrientation}" Value="Top">
<Setter TargetName="toggle" Property="HorizontalAlignment" Value="Center"/>
<Setter TargetName="toggle" Property="VerticalAlignment" Value="Top"/>
<Setter TargetName="toggle" Property="Margin" Value="0,-15,0,0"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style x:Key="MindNodeStyle" TargetType="{x:Type ContentControl}">
<Setter Property="Template" Value="{StaticResource MindNodeLevelStyle}" />
<!--<Style.Triggers>
<DataTrigger Binding="{Binding NodeLevel}" Value="Level1">
<Setter Property="Template" Value="{StaticResource MindLevel1NodeStyle}" />
</DataTrigger>
<DataTrigger Binding="{Binding NodeLevel}" Value="Level2">
<Setter Property="Template" Value="{StaticResource MindLevel2NodeStyle}" />
</DataTrigger>
<DataTrigger Binding="{Binding NodeLevel}" Value="Level3">
<Setter Property="Template" Value="{StaticResource MindLevel3NodeStyle}" />
</DataTrigger>
</Style.Triggers>-->
</Style>
<DataTemplate DataType="{x:Type viewmodel:MindNode}">