<dialog:CustomDialog x:Class="WSDDBBrowser.TechInfoDialog"
        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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WSDDBBrowser"
        mc:Ignorable="d"
                             xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
                xmlns:dialog="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
                     xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
       d:DesignHeight="450" d:DesignWidth="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <DataGrid x:Name="dataGrid" AutoGenerateColumns="False" IsReadOnly="True" ItemsSource="{Binding TechInfos}"
                      RowStyle="{StaticResource MetroDataGridRow}" 
                      >
            <DataGrid.Style>
                <Style BasedOn="{StaticResource MetroDataGrid}" TargetType="{x:Type DataGrid}">
                    <Setter Property="AlternatingRowBackground" Value="{DynamicResource GrayBrush10}" />
                </Style>
            </DataGrid.Style>
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding DeviceId}" Header="设备编号"/>
                <DataGridTextColumn Binding="{Binding DeviceName}" Header="设备名称"/>
                <DataGridTextColumn Binding="{Binding Target,StringFormat={}{0:F1}}" Header="目标值"/>
                <DataGridTextColumn Binding="{Binding Tolerance,StringFormat={}{0:F1}}" Header="公差"/>
                <DataGridTextColumn Binding="{Binding Avg,StringFormat={}{0:F1}}" Header="平均值"/>
                <DataGridTextColumn Binding="{Binding userName}" Header="班组"/>
            </DataGrid.Columns>
        </DataGrid>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,20" Grid.Row="1">
            <StackPanel.Resources>
                <Style TargetType="Button" BasedOn="{StaticResource AccentedSquareButtonStyle}">
                    <Setter Property="FontSize" Value="15"/>
                    <Setter Property="Width" Value="100"/>
                    <Setter Property="Margin" Value="5"/>
                </Style>
            </StackPanel.Resources>
            <Button Content="确定" Click="ButtonOK_Click" />
        </StackPanel>
    </Grid>
</dialog:CustomDialog>
