|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- <Window
- x:Class="BPASmartClient.JXJFoodBigStation.View.SelectRecipesView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:Converter="clr-namespace:BPASmartClient.JXJFoodBigStation.Converter"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:BPASmartClient.JXJFoodBigStation.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:vm="clr-namespace:BPASmartClient.JXJFoodBigStation.ViewModel"
- Title="SelectRecipesView"
- Width="1000"
- Height="620"
- AllowsTransparency="True"
- Background="{x:Null}"
- Topmost="True"
- WindowStartupLocation="CenterScreen"
- WindowStyle="None"
- mc:Ignorable="d">
-
- <Window.DataContext>
- <vm:SelectRecipesViewModel />
- </Window.DataContext>
-
- <Window.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
- <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
-
- </ResourceDictionary.MergedDictionaries>
- <!--修改了勾选的大小-->
- <Style x:Key="CheckBoxLarge" TargetType="{x:Type CheckBox}">
- <Setter Property="Foreground" Value="{DynamicResource foreground}" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="FocusVisualStyle">
- <Setter.Value>
- <Style>
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate>
- <Rectangle
- Margin="1"
- SnapsToDevicePixels="True"
- Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
- StrokeDashArray="1 2"
- StrokeThickness="1" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type CheckBox}">
- <StackPanel
- Background="Transparent"
- Orientation="Horizontal"
- SnapsToDevicePixels="True">
- <Grid>
- <Image
- Width="24"
- Height="28"
- Source="/BPASmartClient.CustomResource;component/Image/Cb_HalfChecked.png" />
- <Image
- x:Name="image1"
- Width="24"
- Height="28"
- Source="/BPASmartClient.CustomResource;component/Image/Cb_HalfChecked.png" />
- </Grid>
- <ContentPresenter
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Content="{TemplateBinding Content}"
- ContentStringFormat="{TemplateBinding ContentStringFormat}"
- RecognizesAccessKey="True"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </StackPanel>
- <ControlTemplate.Triggers>
- <Trigger Property="HasContent" Value="True">
- <Setter Property="FocusVisualStyle">
- <Setter.Value>
- <Style>
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate>
- <Rectangle
- Margin="14,0,0,0"
- SnapsToDevicePixels="True"
- Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
- StrokeDashArray="1 2"
- StrokeThickness="1" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- <Setter Property="Padding" Value="4,0,0,0" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
- </Trigger>
- <Trigger Property="IsChecked" Value="true">
- <Setter TargetName="image1" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/Cb_Checked.png" />
- </Trigger>
- <Trigger Property="IsChecked" Value="{x:Null}">
- <Setter TargetName="image1" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/Cb_HalfChecked.png" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- </ResourceDictionary>
- </Window.Resources>
- <Border
- Name="br"
- BorderBrush="#0CADF5"
- BorderThickness="2">
- <Border.Background>
- <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/bg.png" />
- </Border.Background>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="40" />
- <RowDefinition Height="40" />
- <RowDefinition Height="1*" />
- </Grid.RowDefinitions>
- <TextBlock
- HorizontalAlignment="Center"
- FontSize="35"
- Text="配方筛选界面" />
- <StackPanel
- Grid.Row="1"
- Margin="10,0"
- HorizontalAlignment="Right"
- Orientation="Horizontal">
- <Button
- Width="100"
- Margin="20,0"
- Command="{Binding AllSelectCommand}"
- Content="全选" />
- <Button
- Width="100"
- Margin="20,0"
- Command="{Binding AllCancelCommand}"
- Content="取消全选" />
- <Button
- Width="100"
- Margin="20,0"
- Command="{Binding ConfirmCommand}"
- Content="确认选择" />
- <Button
- Width="100"
- Margin="20,0"
- Command="{Binding CancelCommand}"
- Content="退出" />
- </StackPanel>
- <Border
- Grid.Row="2"
- BorderBrush="#FFA2C2E8"
- BorderThickness="1">
- <!-- 视图显示 -->
- <ListBox
- Margin="5"
- Background="Transparent"
- ItemsSource="{Binding AllRecipes}"
- ScrollViewer.VerticalScrollBarVisibility="Visible">
-
- <ListBox.GroupStyle>
- <GroupStyle>
- <GroupStyle.ContainerStyle>
- <Style BasedOn="{StaticResource ListBoxGroupStyle}" TargetType="{x:Type GroupItem}" />
- </GroupStyle.ContainerStyle>
- </GroupStyle>
- </ListBox.GroupStyle>
-
- <ListBox.ItemTemplate>
- <DataTemplate>
- <StackPanel Orientation="Vertical">
- <StackPanel Orientation="Horizontal">
- <!--<CheckBox Margin="5" Command="{Binding DataContext.CheckCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}" IsChecked="{Binding IsSelected}">
- <CheckBox.CommandParameter>
- <MultiBinding Converter="{StaticResource CheckRecipeConverter}">
- <Binding Path="IsChecked" RelativeSource="{RelativeSource Self}" />
- <Binding Path="RecipeCode" />
- </MultiBinding>
- </CheckBox.CommandParameter>
- </CheckBox>-->
- <CheckBox
- Margin="5"
- IsChecked="{Binding IsSelected, Mode=TwoWay}" Style="{StaticResource CheckBoxLarge}"/>
-
- <TextBlock
- Margin="10"
- VerticalAlignment="Center"
- FontSize="16"
- Text="{Binding Recipe.RecipeCode, StringFormat=配方编号:{0}}" />
- <TextBlock
- Margin="10,0"
- VerticalAlignment="Center"
- FontSize="16"
- Text="{Binding Recipe.RecipeName, StringFormat=配方名称:{0}}" />
- </StackPanel>
- <Line
- Stroke="#FFA2C2E8"
- StrokeThickness="3"
- X1="0"
- X2="1000"
- Y1="0"
- Y2="0" />
- </StackPanel>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </Border>
- </Grid>
- </Border>
- </Window>
|