<Page x:Class="B20UVLog.Pages.LampUseTime"
      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="LampUseTime">
    <Page.DataContext>
        <viewmodels:LampUseTimeViewModel/>
    </Page.DataContext>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <!--<TextBlock Grid.Row="0" Text="Lamp Use Time" 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="Lamp1(Hour)" Binding="{Binding Lamp1UseTime}"/>
                    <DataGridTextColumn Header="Lamp2(Hour)" Binding="{Binding Lamp2UseTime}"/>
                    <DataGridTextColumn Header="Lamp3(Hour)" Binding="{Binding Lamp3UseTime}"/>
                    <DataGridTextColumn Header="Lamp4(Hour)" Binding="{Binding Lamp4UseTime}"/>
                    <DataGridTextColumn Header="Lamp5(Hour)" Binding="{Binding Lamp5UseTime}"/>
                    <DataGridTextColumn Header="Lamp6(Hour)" Binding="{Binding Lamp6UseTime}"/>
                    <DataGridTextColumn Header="Lamp7(Hour)" Binding="{Binding Lamp7UseTime}"/>
                    <DataGridTextColumn Header="Lamp8(Hour)" Binding="{Binding Lamp8UseTime}"/>
                    <DataGridTextColumn Header="Lamp9(Hour)" Binding="{Binding Lamp9UseTime}"/>
                    <DataGridTextColumn Header="Lamp10(Hour)" Binding="{Binding Lamp10UseTime}"/>
                    <DataGridTextColumn Header="Lamp11(Hour)" Binding="{Binding Lamp11UseTime}"/>
                    <DataGridTextColumn Header="Lamp12(Hour)" Binding="{Binding Lamp12UseTime}"/>
                    <DataGridTextColumn Header="Lamp13(Hour)" Binding="{Binding Lamp13UseTime}"/>
                    <DataGridTextColumn Header="Lamp14(Hour)" Binding="{Binding Lamp14UseTime}"/>
                    <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>
