Files
aistudio-wpf-diagram/Extensions/AIStudio.Wpf.Block/Themes/BlockItemViewModel.xaml

68 lines
5.3 KiB
XML

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:viewmodel="clr-namespace:AIStudio.Wpf.Block.ViewModels"
xmlns:model="clr-namespace:AIStudio.Wpf.Block.Models"
xmlns:controls="clr-namespace:AIStudio.Wpf.Block.Controls"
xmlns:dd="https://gitee.com/akwkevin/aistudio.-wpf.-diagram">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Block;component/Themes/Brushes.xaml" />
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Block;component/Themes/Geometries.xaml" />
</ResourceDictionary.MergedDictionaries>
<dd:BoolVisibilityConverter x:Key="BoolVisibilityConverter"/>
<dd:DoubleToThickness x:Key="DoubleToThickness"/>
<dd:ColorBrushConverter x:Key="ColorBrushConverter"/>
<DataTemplate DataType="{x:Type viewmodel:StartBlockItemViewModel}">
<controls:StartBlockBorder Background="{StaticResource EventModulesBackgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource EventModulesBorderBrush}" >
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="当" Foreground="{StaticResource EventModulesForgroundBrush}" VerticalAlignment="Center" IsHitTestVisible="False"/>
<Path Width="13" Height="16" Margin="5" Stretch="Fill" Fill="{StaticResource FlagBrush}" Data="{StaticResource FlagGeometry}" VerticalAlignment="Center" IsHitTestVisible="False"/>
<TextBlock Text="被点击" Foreground="{StaticResource EventModulesForgroundBrush}" VerticalAlignment="Center" IsHitTestVisible="False"/>
</StackPanel>
</controls:StartBlockBorder>
</DataTemplate>
<DataTemplate DataType="{x:Type viewmodel:KeyboardPressBlockItemViewModel}">
<controls:StartBlockBorder Background="{StaticResource EventModulesBackgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource EventModulesBorderBrush}" >
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False">
<TextBlock Text="当按下" Foreground="{StaticResource EventModulesForgroundBrush}" VerticalAlignment="Center" IsHitTestVisible="False"/>
<ComboBox ItemsSource="{Binding KeyItemsSource}" SelectedValue="{Binding Key}" Background="Transparent" VerticalAlignment="Center" />
</StackPanel>
</controls:StartBlockBorder>
</DataTemplate>
<DataTemplate DataType="{x:Type viewmodel:WaitTimeBlockItemViewModel}">
<controls:NextBlockBorder Background="{StaticResource ControlModulesBackgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource ControlModulesBorderBrush}" >
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="等待" Foreground="{StaticResource ControlModulesForgroundBrush}" VerticalAlignment="Center" IsHitTestVisible="False"/>
<controls:VariableBlockBorder Background="{StaticResource ControlModulesForgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource ControlModulesBorderBrush}" Minwidth="28" Minheight="22" Margin="5,0">
<ContentControl Content="{Binding Second}" />
</controls:VariableBlockBorder>
<TextBlock Text="秒" Foreground="{StaticResource ControlModulesForgroundBrush}" VerticalAlignment="Center" IsHitTestVisible="False"/>
</StackPanel>
</controls:NextBlockBorder>
</DataTemplate>
<DataTemplate DataType="{x:Type model:ConstParameter}">
<Border>
<TextBox BorderThickness="0" TextAlignment="Center" VerticalAlignment="Center" Background="Transparent"/>
</Border>
</DataTemplate>
<DataTemplate DataType="{x:Type viewmodel:AddBlockItemViewModel}">
<Grid>
<controls:VariableBlockBorder Background="{StaticResource ArithmeticModulesBackgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource ArithmeticModulesBorderBrush}" >
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<controls:VariableBlockBorder Background="{StaticResource ArithmeticModulesForgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource ArithmeticModulesBorderBrush}" Minwidth="28" Minheight="22" Margin="5,0">
<ContentControl Content="{Binding Add1}" />
</controls:VariableBlockBorder>
<TextBlock Text="+" Foreground="{StaticResource ControlModulesForgroundBrush}" FontSize="12" VerticalAlignment="Center" IsHitTestVisible="False"/>
<controls:VariableBlockBorder Background="{StaticResource ArithmeticModulesForgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource ArithmeticModulesBorderBrush}" Minwidth="28" Minheight="22" Margin="5,0">
<ContentControl Content="{Binding Add2}" />
</controls:VariableBlockBorder>
</StackPanel>
</controls:VariableBlockBorder>
</Grid>
</DataTemplate>
</ResourceDictionary>