<Page x:Class="B20UVLog.Pages.GlassInformation"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:B20UVLog.Pages" xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
      Title="GlassInformation">
    <Page.DataContext>
        <viewmodels:GlassInformationViewModel/>
    </Page.DataContext>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <!--<TextBlock Grid.Row="0" Text="Glass Information" FontSize="25" Margin="10 5"/>-->
        <StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center">
            <!--<My:MTextBox x:Name="TextIndex" Title="Index_No"/>-->
            <My:MDateTimePicker x:Name="DTPStart" Title="开始时间"/>
            <TextBlock Text="--" VerticalAlignment="Center" Margin="2"/>
            <My:MDateTimePicker x:Name="DTPEnd" Title="结束时间"/>
            <My:MButton x:Name="BtnSearch" Content="查询" Type="Primary"  Click="BtnSearch_Click"/>
            <My:MButton x:Name="BtnReset" Content="条件重置"  Click="BtnReset_Click"/>
            <My:MButton x:Name="BtnExport" Content="导出报表"  Click="BtnExport_Click" Type="Warning"/>
        </StackPanel>
        <Grid Grid.Row="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="auto"/>
            </Grid.RowDefinitions>
            <My:MDataGrid  ItemsSource="{Binding GridData}" >
                <DataGrid.Columns>
                    <DataGridTextColumn Header="LordingTime" Binding="{Binding LordingTime}"/>
                    <DataGridTextColumn Header="UnlordingTime" Binding="{Binding UnlordingTime}"/>
                    <DataGridTextColumn Header="GlassID1" Binding="{Binding GlassID1}"/>
                    <DataGridTextColumn Header="GlassID2" Binding="{Binding GlassID2}"/>
                    <DataGridTextColumn Header="GlassID3" Binding="{Binding GlassID3}"/>
                    <DataGridTextColumn Header="GlassID4" Binding="{Binding GlassID4}"/>
                    <DataGridTextColumn Header="GlassID5" Binding="{Binding GlassID5}"/>
                    <DataGridTextColumn Header="GlassID6" Binding="{Binding GlassID6}"/>
                    <DataGridTextColumn Header="GlassID7" Binding="{Binding GlassID7}"/>
                    <DataGridTextColumn Header="GlassID8" Binding="{Binding GlassID8}"/>
                    <DataGridTextColumn Header="GlassID9" Binding="{Binding GlassID9}"/>
                    <DataGridTextColumn Header="GlassID10" Binding="{Binding GlassID10}"/>
                    <DataGridTextColumn Header="QTimeData(s)" Binding="{Binding QTimeData}"/>
                    <DataGridTextColumn Header="TactTime(s)" Binding="{Binding TactTime,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="AlignmentResult" Binding="{Binding AlignmentResult}"/>
                    <DataGridTextColumn Header="dx-L(μm)" Binding="{Binding AlignmentResult_dxL}"/>
                    <DataGridTextColumn Header="dy-L(μm)" Binding="{Binding AlignmentResult_dyL}"/>
                    <DataGridTextColumn Header="dx-R(μm)" Binding="{Binding AlignmentResult_dxR}"/>
                    <DataGridTextColumn Header="dy-R(μm)" Binding="{Binding AlignmentResult_dyR}"/>
                    <DataGridTextColumn Header="X(μm)" Binding="{Binding AlignmentResult_X}"/>
                    <DataGridTextColumn Header="Y(μm)" Binding="{Binding AlignmentResult_Y}"/>
                    <DataGridTextColumn Header="Z(度)" Binding="{Binding AlignmentResult_Z,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.0001}"/>
                    <DataGridTextColumn Header="IrradiationTime(s)" Binding="{Binding IrradiationTime,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="L1-Luminance(W/cm²)" Binding="{Binding L1Luminance,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="L2-Luminance(W/cm²)" Binding="{Binding L2Luminance,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="L3-Luminance(W/cm²)" Binding="{Binding L3Luminance,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="L4-Luminance(W/cm²)" Binding="{Binding L4Luminance,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="L5-Luminance(W/cm²)" Binding="{Binding L5Luminance,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="L6-Luminance(W/cm²)" Binding="{Binding L6Luminance,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="L7-Luminance(W/cm²)" Binding="{Binding L7Luminance,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="L8-Luminance(W/cm²)" Binding="{Binding L8Luminance,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="L9-Luminance(W/cm²)" Binding="{Binding L9Luminance,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="L10-Luminance(W/cm²)" Binding="{Binding L10Luminance,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="L11-Luminance(W/cm²)" Binding="{Binding L11Luminance,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="L12-Luminance(W/cm²)" Binding="{Binding L12Luminance,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="L13-Luminance(W/cm²)" Binding="{Binding L13Luminance,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="L14-Luminance(W/cm²)" Binding="{Binding L14Luminance,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="记录时间" Binding="{Binding RecordTime,StringFormat=yyyy-MM-dd HH:mm:ss}"/>
                </DataGrid.Columns>
            </My:MDataGrid>
            <My:MPagination Grid.Row="1" x:Name="MyPagination" PageIndexChange="MyPagination_PageIndexChange" PageSizeChange="MyPagination_PageSizeChange"/>
        </Grid>

    </Grid>

</Page>
