<UserControl
    x:Class="BPA.SingleDevice.View.RecipeStatusView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:bpa="http://BPAUIControl.io/winfx/xaml/toolkit"
    xmlns:conv="clr-namespace:BPA.SingleDevice.Converters"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    d:DesignHeight="450"
    d:DesignWidth="800"
    mc:Ignorable="d">
    <UserControl.Resources>
        <conv:DictionaryValueConverter x:Key="DictionaryValueConverter" />
        <conv:DictionaryValueMultiConverter x:Key="DictionaryValueMultiConverter" />
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>

        <!--#region 待制作-->

        <!--#endregion-->

        <!--#region 制作中-->
        <!--<Border BorderBrush="Gray" Margin="5" BorderThickness="3" Grid.Column="1">
            <ListView ItemsSource="{Binding CurrentRecipes}" SelectionMode="Single">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" Margin="5">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="1*" />
                                <RowDefinition Height="1*" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="1*" />
                                <ColumnDefinition Width="1*" />
                            </Grid.ColumnDefinitions>
                            <TextBlock Text="{Binding Name,StringFormat=名称：{0}}" FontSize="16" />
                            <TextBlock Text="{Binding CurrentStation}" FontSize="16" Margin="10,0" />
                        </StackPanel>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </Border>-->
        <!--#endregion-->

        <bpa:ControlDisplay Grid.Column="0" Grid.ColumnSpan="2">
            <DataGrid
                Grid.Row="1"
                bpa:HeaderHelper.HorizontalAlignment="Center"
                AutoGenerateColumns="False"
                BorderBrush="Gray"
                BorderThickness="1"
                CanUserAddRows="False"
                CanUserDeleteRows="False"
                CanUserReorderColumns="False"
                CanUserResizeColumns="False"
                CanUserResizeRows="False"
                CanUserSortColumns="False"
                GridLinesVisibility="All"
                IsReadOnly="False"
                ItemsSource="{Binding CurrentRecipes}"
                RowHeight="70"
                SelectionMode="Single">
                <DataGrid.Columns>
                    <DataGridTextColumn
                        Width="*"
                        Binding="{Binding Name}"
                        Header="配方名称" />
                    <DataGridTextColumn
                        Width="420"
                        Binding="{Binding IssueTime, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}"
                        Header="下发时间" />
                    <DataGridTextColumn
                        Width="420"
                        Binding="{Binding StartTime, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}"
                        Header="开始时间" />
                    <DataGridTextColumn
                        Width="180"
                        Binding="{Binding CurrentStation}"
                        Header="当前工站" />
                    <DataGridTextColumn Width="420" Header="当前工站进度">
                        <DataGridTextColumn.Binding>
                            <MultiBinding Converter="{StaticResource DictionaryValueMultiConverter}">
                                <Binding Path="BatchStatus" />
                                <Binding Path="CurrentStation" />
                            </MultiBinding>
                        </DataGridTextColumn.Binding>
                    </DataGridTextColumn>
                    <!--<DataGridTemplateColumn Width="150" Header="删除">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Button
                                    Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=local:RecipeStatusView}}"
                                    CommandParameter="{Binding}"
                                    Style="{StaticResource TextErrorButton}">
                                    <bpa:Icon Type="DeleteBinFill" />
                                </Button>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>-->
                </DataGrid.Columns>
            </DataGrid>
        </bpa:ControlDisplay>
    </Grid>
</UserControl>