|
- <Window
- x:Class="BPASmartClient.FoodStationTest.View.SelectRecipesView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:BPASmartClient.FoodStationTest.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:vm="clr-namespace:BPASmartClient.FoodStationTest.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>
|