<Page x:Class="B20UVLog.Pages.LampData"
      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="LampData">
    <Page.DataContext>
        <viewmodels:LampDataViewModel/>
    </Page.DataContext>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <!--<TextBlock Grid.Row="0" Text="IO" 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="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="Lamp1电流(A)" Binding="{Binding Lamp1Current,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.01}"/>
                    <DataGridTextColumn Header="Lamp2电流(A)" Binding="{Binding Lamp2Current,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.01}"/>
                    <DataGridTextColumn Header="Lamp3电流(A)" Binding="{Binding Lamp3Current,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.01}"/>
                    <DataGridTextColumn Header="Lamp4电流(A)" Binding="{Binding Lamp4Current,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.01}"/>
                    <DataGridTextColumn Header="Lamp5电流(A)" Binding="{Binding Lamp5Current,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.01}"/>
                    <DataGridTextColumn Header="Lamp6电流(A)" Binding="{Binding Lamp6Current,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.01}"/>
                    <DataGridTextColumn Header="Lamp7电流(A)" Binding="{Binding Lamp7Current,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.01}"/>
                    <DataGridTextColumn Header="Lamp8电流(A)" Binding="{Binding Lamp8Current,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.01}"/>
                    <DataGridTextColumn Header="Lamp9电流(A)" Binding="{Binding Lamp9Current,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.01}"/>
                    <DataGridTextColumn Header="Lamp10电流(A)" Binding="{Binding Lamp10Current,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.01}"/>
                    <DataGridTextColumn Header="Lamp11电流(A)" Binding="{Binding Lamp11Current,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.01}"/>
                    <DataGridTextColumn Header="Lamp12电流(A)" Binding="{Binding Lamp12Current,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.01}"/>
                    <DataGridTextColumn Header="Lamp13电流(A)" Binding="{Binding Lamp13Current,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.01}"/>
                    <DataGridTextColumn Header="Lamp14电流(A)" Binding="{Binding Lamp14Current,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.01}"/>
                    <DataGridTextColumn Header="Lamp1电压(V)" Binding="{Binding Lamp1Voltage}"/>
                    <DataGridTextColumn Header="Lamp2电压(V)" Binding="{Binding Lamp2Voltage}"/>
                    <DataGridTextColumn Header="Lamp3电压(V)" Binding="{Binding Lamp3Voltage}"/>
                    <DataGridTextColumn Header="Lamp4电压(V)" Binding="{Binding Lamp4Voltage}"/>
                    <DataGridTextColumn Header="Lamp5电压(V)" Binding="{Binding Lamp5Voltage}"/>
                    <DataGridTextColumn Header="Lamp6电压(V)" Binding="{Binding Lamp6Voltage}"/>
                    <DataGridTextColumn Header="Lamp7电压(V)" Binding="{Binding Lamp7Voltage}"/>
                    <DataGridTextColumn Header="Lamp8电压(V)" Binding="{Binding Lamp8Voltage}"/>
                    <DataGridTextColumn Header="Lamp9电压(V)" Binding="{Binding Lamp9Voltage}"/>
                    <DataGridTextColumn Header="Lamp10电压(V)" Binding="{Binding Lamp10Voltage}"/>
                    <DataGridTextColumn Header="Lamp11电压(V)" Binding="{Binding Lamp11Voltage}"/>
                    <DataGridTextColumn Header="Lamp12电压(V)" Binding="{Binding Lamp12Voltage}"/>
                    <DataGridTextColumn Header="Lamp13电压(V)" Binding="{Binding Lamp13Voltage}"/>
                    <DataGridTextColumn Header="Lamp14电压(V)" Binding="{Binding Lamp14Voltage}"/>
                    <DataGridTextColumn Header="Lamp1出力(W/cm)" Binding="{Binding Lamp1Output}"/>
                    <DataGridTextColumn Header="Lamp2出力(W/cm)" Binding="{Binding Lamp2Output}"/>
                    <DataGridTextColumn Header="Lamp3出力(W/cm)" Binding="{Binding Lamp3Output}"/>
                    <DataGridTextColumn Header="Lamp4出力(W/cm)" Binding="{Binding Lamp4Output}"/>
                    <DataGridTextColumn Header="Lamp5出力(W/cm)" Binding="{Binding Lamp5Output}"/>
                    <DataGridTextColumn Header="Lamp6出力(W/cm)" Binding="{Binding Lamp6Output}"/>
                    <DataGridTextColumn Header="Lamp7出力(W/cm)" Binding="{Binding Lamp7Output}"/>
                    <DataGridTextColumn Header="Lamp8出力(W/cm)" Binding="{Binding Lamp8Output}"/>
                    <DataGridTextColumn Header="Lamp9出力(W/cm)" Binding="{Binding Lamp9Output}"/>
                    <DataGridTextColumn Header="Lamp10出力(W/cm)" Binding="{Binding Lamp10Output}"/>
                    <DataGridTextColumn Header="Lamp11出力(W/cm)" Binding="{Binding Lamp11Output}"/>
                    <DataGridTextColumn Header="Lamp12出力(W/cm)" Binding="{Binding Lamp12Output}"/>
                    <DataGridTextColumn Header="Lamp13出力(W/cm)" Binding="{Binding Lamp13Output}"/>
                    <DataGridTextColumn Header="Lamp14出力(W/cm)" Binding="{Binding Lamp14Output}"/>
                    <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>
