<UserControl
    x:Class="HBLConsole.View.OrderStatusView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:con="clr-namespace:HBLConsole.Converter"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="clr-namespace:HBLConsole.View"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vm="clr-namespace:HBLConsole.ViewModel"
    d:DesignHeight="450"
    d:DesignWidth="800"
    Background="{x:Null}"
    mc:Ignorable="d">

    <!--<UserControl.DataContext>
        <vm:OrderStatusViewModel />
    </UserControl.DataContext>-->

    <UserControl.Resources>
        <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="#FF2AB2E7" />
        <SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" />

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

        <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>
    </UserControl.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>

        <!--#region 制作中的订单列表-->
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="30" />
                <RowDefinition />
            </Grid.RowDefinitions>

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

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

                <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>

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

                <TextBlock
                    Grid.Column="6"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    FontSize="16"
                    Foreground="{StaticResource TitleFontColor}"
                    Text="完成时间" />

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

            <!--#region 表格数据显示-->
            <ScrollViewer
                Grid.Row="1"
                HorizontalScrollBarVisibility="Hidden"
                VerticalScrollBarVisibility="Hidden">
                <ItemsControl ItemsSource="{Binding orderStatusLists}">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Grid Height="30">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.3*" />
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="0.7*" />
                                    <ColumnDefinition Width="0.7*" />
                                    <ColumnDefinition Width="0" />
                                    <ColumnDefinition Width="0.7*" />
                                    <ColumnDefinition Width="0.5*" />
                                </Grid.ColumnDefinitions>

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

                                <Grid Grid.Column="1">
                                    <TextBlock
                                        Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
                                        Style="{StaticResource TextBlockStyle}"
                                        Text="{Binding OrderPush.GoodsName}" />
                                    <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 StartDate}" />

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


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

                                <Grid Grid.Column="6">
                                    <TextBlock
                                        Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
                                        Style="{StaticResource TextBlockStyle}"
                                        Text="{Binding CookDateTime}" />
                                    <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="0,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="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="30" />
                <RowDefinition />
            </Grid.RowDefinitions>

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

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

                <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>

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

                <TextBlock
                    Grid.Column="6"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    FontSize="16"
                    Foreground="{StaticResource TitleFontColor}"
                    Text="完成时间" />

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

            <!--#region 表格数据显示-->
            <ScrollViewer
                Grid.Row="1"
                HorizontalScrollBarVisibility="Hidden"
                VerticalScrollBarVisibility="Hidden">
                <ItemsControl ItemsSource="{Binding WaitTakeMeal}">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Grid Height="30">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.3*" />
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="0.7*" />
                                    <ColumnDefinition Width="0.7*" />
                                    <ColumnDefinition Width="0" />
                                    <ColumnDefinition Width="0.7*" />
                                    <ColumnDefinition Width="0.5*" />
                                </Grid.ColumnDefinitions>

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

                                <Grid Grid.Column="1">
                                    <TextBlock
                                        Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
                                        Style="{StaticResource TextBlockStyle}"
                                        Text="{Binding OrderPush.GoodsName}" />
                                    <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 StartDate}" />

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


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

                                <Grid Grid.Column="6">
                                    <TextBlock
                                        Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
                                        Style="{StaticResource TextBlockStyle}"
                                        Text="{Binding CookDateTime}" />
                                    <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="0,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-->

    </Grid>
</UserControl>
