<UserControl
    x:Class="BPA.SingleDevice.View.AddRawMaterialDialogView"
    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:BPA.SingleDevice.View"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:bpa="http://BPAUIControl.io/winfx/xaml/toolkit"
    xmlns:vm="clr-namespace:BPA.SingleDevice.ViewModel"
    d:DesignHeight="300"
    d:DesignWidth="500"
    mc:Ignorable="d">

    <UserControl.DataContext>
        <vm:AddRawMaterialDialogViewModel />
    </UserControl.DataContext>

    <Grid Margin="10" bpa:PanelHelper.Spacing="10">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="130" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>

        <TextBlock
            Grid.Row="0"
            Grid.Column="0"
            HorizontalAlignment="Right"
            FontSize="16"
            Foreground="#ddd"
            Text="原料名称：" />
        <TextBox
            Grid.Row="0"
            Grid.Column="1"
            Width="200"
            Style="{StaticResource DarkTextBox}"
            Text="{Binding RawMaterResultInfo.Name}" />

        <TextBlock
            Grid.Row="1"
            Grid.Column="0"
            HorizontalAlignment="Right"
            FontSize="16"
            Foreground="#ddd"
            Text="设备编号：" />
        <ComboBox
            Grid.Row="1"
            Grid.Column="1"
            ItemsSource="{Binding DeviceNums}"
            SelectedIndex="0"
            Text="{Binding RawMaterResultInfo.DeviceNum}" />

        <TextBlock
            Grid.Row="2"
            Grid.Column="0"
            HorizontalAlignment="Right"
            FontSize="16"
            Foreground="#ddd"
            Text="设备料仓编号：" />
        <ComboBox
            Grid.Row="2"
            Grid.Column="1"
            ItemsSource="{Binding ChNum}"
            SelectedIndex="0"
            Text="{Binding RawMaterResultInfo.ChNum}" />

        <Grid
            Grid.Row="3"
            Grid.ColumnSpan="2"
            Margin="0,5"
            bpa:PanelHelper.Spacing="10">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Button
                Grid.Column="0"
                Command="{Binding SaveCommand}"
                Content="确认" />
            <Button
                Grid.Column="1"
                Command="{Binding CancelCommand}"
                Content="取消" />
        </Grid>

    </Grid>
</UserControl>
