<Window
    x:Class="BPASmartClient.OrderListDialogView"
    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"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vm="clr-namespace:BPASmartClient.ViewModel;assembly=BPASmartClient.ViewModel"
    Title="OrderListDialogView"
    Width="800"
    Height="450"
    AllowsTransparency="True"
    Background="{x:Null}"
    MouseMove="Window_MouseMove"
    Opacity="0.8"
    Topmost="True"
    WindowStartupLocation="CenterScreen"
    WindowStyle="None"
    mc:Ignorable="d">


    <Window.DataContext>
        <vm:OrderListDialogViewModel />
    </Window.DataContext>

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary>
                    <SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
                    <SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
                    <SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
                    <SolidColorBrush x:Key="CursorColor" Color="Aqua" />
                    <SolidColorBrush x:Key="TitleBorderColor" Color="#552AB2E7" />
                    <SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" />

                    <!--<con:ColorConverter x:Key="ColorConverter" />
                    <con:TextConverter x:Key="TextConverter" />-->

                    <Style x:Key="buttonStyle" TargetType="Button">
                        <Setter Property="FontFamily" Value="楷体" />
                        <Setter Property="Width" Value="100" />
                        <Setter Property="FontSize" Value="18" />
                        <Setter Property="Foreground" Value="Aqua" />
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="Button">
                                    <Grid x:Name="gr">
                                        <ContentControl
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            Content="{TemplateBinding Content}"
                                            Foreground="{TemplateBinding Foreground}" />
                                        <Polygon
                                            x:Name="poly"
                                            Points="0 0,80 0,100 30,20 30"
                                            Stroke="#FF34F7F7"
                                            StrokeThickness="2" />
                                    </Grid>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter TargetName="poly" Property="Fill" Value="#2234F7F7" />
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>

                    <Style x:Key="TextBlockStyle" TargetType="TextBlock">
                        <Setter Property="FontFamily" Value="楷体" />
                        <Setter Property="FontSize" Value="16" />
                        <Setter Property="Background" Value="Transparent" />
                        <!--<Setter Property="Foreground" Value="{StaticResource FontColor}" />-->
                        <Setter Property="VerticalAlignment" Value="Center" />
                        <Setter Property="HorizontalAlignment" Value="Center" />
                    </Style>

                </ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid Background="#103153">
        <Grid.RowDefinitions>
            <RowDefinition Height="35" />
            <RowDefinition />
            <RowDefinition Height="50" />
        </Grid.RowDefinitions>

        <!--#region 标题栏设置-->
        <Border
            x:Name="MoveBorder"
            Height="35"
            VerticalAlignment="Top"
            Background="#0C2349"
            BorderBrush="#55ffffff"
            BorderThickness="0,0,0,1">
            <StackPanel Orientation="Horizontal">
                <Image Margin="15,5,0,5" Source="pack://application:,,,/BPASmartClient.CustomResource;component/Image/HBL.png" />
                <TextBlock
                    Name="tbTitle"
                    Margin="10,0"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Center"
                    FontSize="18"
                    Foreground="White"
                    Text="订单数据" />
            </StackPanel>
        </Border>

        <UniformGrid
            Width="150"
            Height="30"
            HorizontalAlignment="Right"
            Columns="3">
            <Button
                Name="ButMin"
                Content="&#xe664;"
                Style="{StaticResource TitleBarStyle}"
                Visibility="Hidden" />
            <Button
                Name="ButMax"
                Content="&#xe65d;"
                Style="{StaticResource TitleBarStyle}"
                Visibility="Hidden" />
            <Button
                Name="ButClose"
                Command="{Binding CloseCommand}"
                Content="&#xe602;"
                FontSize="30"
                Style="{StaticResource TitleBarStyle}" />
        </UniformGrid>
        <!--#endregion-->

        <!--#region 表单数据-->
        <Grid Grid.Row="1">
            <!--<Grid.RowDefinitions>
                <RowDefinition Height="30" />
                <RowDefinition />
            </Grid.RowDefinitions>-->

            <!--#region 表格标题栏设置-->
            <!--
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.1*" />
                    <ColumnDefinition Width="0.3*" />
                    <ColumnDefinition />
                    <ColumnDefinition Width="0.7*" />
                </Grid.ColumnDefinitions>

                <CheckBox
                    Height="20"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Background="#FF2AB2E7"
                    Content=""
                    FontSize="14"
                    Foreground="#ddd"
                    IsChecked="{Binding AllSelected}"
                    Template="{StaticResource CbTemplate}" />

                <Border
                    Grid.Column="1"
                    Grid.ColumnSpan="3"
                    Background="#882AB2E7" />

                <Grid Grid.Column="1">
                    <TextBlock
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        FontSize="16"
                        Foreground="{StaticResource TitleFontColor}"
                        Text="取餐号" />
                    <Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="1,0,1,0" />
                </Grid>

                <TextBlock
                    Grid.Column="2"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    FontSize="16"
                    Foreground="{StaticResource TitleFontColor}"
                    Text="商品名称" />

                <Grid Grid.Column="3">
                    <TextBlock
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        FontSize="16"
                        Foreground="{StaticResource TitleFontColor}"
                        Text="订单状态" />
                    <Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="1,0,1,0" />
                </Grid>

                <Border
                    Grid.ColumnSpan="8"
                    BorderBrush="{StaticResource BorderSolid}"
                    BorderThickness="1,0,1,1" />


            </Grid>
            -->
            <!--#endregion-->

            <!--#region 表格数据显示-->
            <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
                <ItemsControl ItemsSource="{Binding orderStatusLists}">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Grid>
                                <StackPanel Margin="0,0,0,15">
                                    <CheckBox
                                        Height="20"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Center"
                                        Background="#FF2AB2E7"
                                        Content="{Binding DeviceId}"
                                        FontSize="14"
                                        Foreground="#ddd"
                                        IsChecked="{Binding IsAllSelect}"
                                        Template="{StaticResource CbTemplate}" />

                                    <!--#region 表格标题栏设置-->
                                    <Grid Height="30" Margin="23,5,0,0">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="0.068*" />
                                            <ColumnDefinition Width="0.3*" />
                                            <ColumnDefinition />
                                            <ColumnDefinition Width="0.7*" />
                                        </Grid.ColumnDefinitions>

                                        <!--<CheckBox
                                            Height="20"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            Background="#FF2AB2E7"
                                            Content=""
                                            FontSize="14"
                                            Foreground="#ddd"
                                            IsChecked="{Binding AllSelected}"
                                            Template="{StaticResource CbTemplate}" />-->

                                        <!--<Border
                                            Grid.Column="1"
                                            Grid.ColumnSpan="3"
                                            Background="#882AB2E7" />-->

                                        <Grid Grid.Column="1">
                                            <TextBlock
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Center"
                                                FontSize="16"
                                                Foreground="{StaticResource TitleFontColor}"
                                                Text="取餐号" />
                                            <Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="1,0,1,0" />
                                        </Grid>

                                        <TextBlock
                                            Grid.Column="2"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            FontSize="16"
                                            Foreground="{StaticResource TitleFontColor}"
                                            Text="商品名称" />

                                        <Grid Grid.Column="3">
                                            <TextBlock
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Center"
                                                FontSize="16"
                                                Foreground="{StaticResource TitleFontColor}"
                                                Text="订单状态" />
                                            <Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="1,0,1,0" />
                                        </Grid>

                                        <Border
                                            Grid.Column="1"
                                            Grid.ColumnSpan="3"
                                            Background="#882AB2E7"
                                            BorderBrush="{StaticResource BorderSolid}"
                                            BorderThickness="1,0,1,1" />
                                    </Grid>
                                    <!--#endregion-->

                                    <ItemsControl ItemsSource="{Binding morkOrderPushes}">
                                        <ItemsControl.ItemTemplate>
                                            <DataTemplate>
                                                <Grid Height="30" Margin="23,0,0,0">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="0.068*" />
                                                        <ColumnDefinition Width="0.3*" />
                                                        <ColumnDefinition />
                                                        <ColumnDefinition Width="0.7*" />
                                                    </Grid.ColumnDefinitions>

                                                    <CheckBox
                                                        Height="20"
                                                        HorizontalAlignment="Center"
                                                        VerticalAlignment="Center"
                                                        Background="#FF2AB2E7"
                                                        Content=""
                                                        FontSize="14"
                                                        Foreground="#ddd"
                                                        IsChecked="{Binding IsSelected}"
                                                        Template="{StaticResource CbTemplate}" />

                                                    <Grid Grid.Column="1">
                                                        <TextBlock
                                                            Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
                                                            Style="{StaticResource TextBlockStyle}"
                                                            Text="{Binding OrderPush.SortNum}" />
                                                        <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
                                                    </Grid>

                                                    <TextBlock
                                                        Grid.Column="2"
                                                        Margin="5,0,0,0"
                                                        HorizontalAlignment="Left"
                                                        Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
                                                        Style="{StaticResource TextBlockStyle}"
                                                        Text="{Binding OrderPush.GoodsName}" />

                                                    <Grid Grid.Column="3">
                                                        <TextBlock
                                                            Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
                                                            Style="{StaticResource TextBlockStyle}"
                                                            Text="{Binding OrderStatus, Converter={StaticResource TextConverter}}" />
                                                        <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
                                                    </Grid>

                                                    <Border
                                                        Grid.Column="1"
                                                        Grid.ColumnSpan="8"
                                                        BorderBrush="{StaticResource BorderSolid}"
                                                        BorderThickness="1,0,1,1" />

                                                </Grid>
                                            </DataTemplate>
                                        </ItemsControl.ItemTemplate>
                                    </ItemsControl>

                                </StackPanel>


                            </Grid>

                            <!--<Grid Height="30">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.1*" />
                                    <ColumnDefinition Width="0.3*" />
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="0.7*" />
                                </Grid.ColumnDefinitions>

                                <CheckBox
                                    Height="20"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Background="#FF2AB2E7"
                                    Content=""
                                    FontSize="14"
                                    Foreground="#ddd"
                                    IsChecked="{Binding IsSelected}"
                                    Template="{StaticResource CbTemplate}" />

                                <Grid Grid.Column="1">
                                    <TextBlock
                                        Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
                                        Style="{StaticResource TextBlockStyle}"
                                        Text="{Binding OrderPush.SortNum}" />
                                    <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
                                </Grid>

                                <TextBlock
                                    Grid.Column="2"
                                    Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
                                    Style="{StaticResource TextBlockStyle}"
                                    Text="{Binding OrderPush.GoodsName}" />

                                <Grid Grid.Column="3">
                                    <TextBlock
                                        Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
                                        Style="{StaticResource TextBlockStyle}"
                                        Text="{Binding OrderStatus, Converter={StaticResource TextConverter}}" />
                                    <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
                                </Grid>

                                <Border
                                    Grid.ColumnSpan="8"
                                    BorderBrush="{StaticResource BorderSolid}"
                                    BorderThickness="1,0,1,1" />

                            </Grid>-->
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </ScrollViewer>
            <!--#endregion-->

        </Grid>
        <!--#endregion-->

        <!--#region 信息取-->
        <Grid Grid.Row="2">

            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="0.2*" />
                <ColumnDefinition Width="0.2*" />
            </Grid.ColumnDefinitions>

            <TextBlock
                Margin="10,0,0,0"
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                FontFamily="楷体"
                FontSize="20"
                Foreground="Yellow"
                Text="请选择需要继续制作的订单,取消或关闭将删除所有订单。" />

            <Button
                Grid.Column="1"
                VerticalAlignment="Center"
                Command="{Binding CancelCommand}"
                Content="取消"
                Style="{StaticResource buttonStyle}" />

            <Button
                Grid.Column="2"
                VerticalAlignment="Center"
                Command="{Binding ConfirmCommand}"
                Content="确认"
                Style="{StaticResource buttonStyle}" />
        </Grid>
        <!--#endregion-->

    </Grid>


</Window>
