<Page x:Class="B20UVLog.Pages.AxisData"
      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="AxisData">
    <Page.DataContext>
        <viewmodels:AxisDataViewModel/>
    </Page.DataContext>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <!--<TextBlock Grid.Row="0" Text="Axis Data" FontSize="25" Margin="10 5"/>-->
        <StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center">
            <My:MComboBox SelectedIndex="{Binding DataGroupIndex}" Title="请选择数据组" SelectionChanged="MComboBox_SelectionChanged">
                <ComboBoxItem>WSZ1,2,3,4</ComboBoxItem>
                <ComboBoxItem>WSX1,2 WSY1,2</ComboBoxItem>
                <ComboBoxItem>CSXL,CSYL,CSZL</ComboBoxItem>
                <ComboBoxItem>CSXR,CSYR,CSZR</ComboBoxItem>
                <ComboBoxItem>WSL,WSS</ComboBoxItem>
            </My:MComboBox>
            <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"/>
            <My:MButton x:Name="BtnChart" Content="图表"  Click="BtnChart_Click" Type="Success"/>
        </StackPanel>
        <Grid Grid.Row="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="auto"/>
            </Grid.RowDefinitions>
            <My:MDataGrid x:Name="DataGridAll" ItemsSource="{Binding GridDataAll}">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="WSZ1(mm)" Binding="{Binding WSZ1,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="WSZ2(mm)" Binding="{Binding WSZ2,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="WSZ3(mm)" Binding="{Binding WSZ3,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="WSZ4(mm)" Binding="{Binding WSZ4,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="WSX1(mm)" Binding="{Binding WSX1,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="WSX2(mm)" Binding="{Binding WSX2,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="WSY1(mm)" Binding="{Binding WSY1,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="WSY2(mm)" Binding="{Binding WSY2,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="CSXL(mm)" Binding="{Binding CSXL,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="CSYL(mm)" Binding="{Binding CSYL,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="CSZL(mm)" Binding="{Binding CSZL,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="CSXR(mm)" Binding="{Binding CSXR,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.0001}"/>
                    <DataGridTextColumn Header="CSYR(mm)" Binding="{Binding CSYR,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.0001}"/>
                    <DataGridTextColumn Header="CSZR(度)" Binding="{Binding CSZR,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.00001}"/>
                    <DataGridTextColumn Header="WSL(mm)" Binding="{Binding WSL,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="WSS(mm)" Binding="{Binding WSS,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="记录时间" Binding="{Binding RecordTime,StringFormat=yyyy-MM-dd HH:mm:ss}"/>
                </DataGrid.Columns>
            </My:MDataGrid>
            <My:MDataGrid x:Name="DataGrid1" ItemsSource="{Binding GridData1}" Visibility="Collapsed">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="WSZ1(mm)" Binding="{Binding WSZ1,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="WSZ2(mm)" Binding="{Binding WSZ2,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="WSZ3(mm)" Binding="{Binding WSZ3,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="WSZ4(mm)" Binding="{Binding WSZ4,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="记录时间" Binding="{Binding RecordTime,StringFormat=yyyy-MM-dd HH:mm:ss}"/>
                </DataGrid.Columns>
            </My:MDataGrid>
            <My:MDataGrid x:Name="DataGrid2" ItemsSource="{Binding GridData2}" Visibility="Collapsed">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="WSX1(mm)" Binding="{Binding WSX1,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="WSX2(mm)" Binding="{Binding WSX2,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="WSY1(mm)" Binding="{Binding WSY1,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="WSY2(mm)" Binding="{Binding WSY2,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="记录时间" Binding="{Binding RecordTime,StringFormat=yyyy-MM-dd HH:mm:ss}"/>
                </DataGrid.Columns>
            </My:MDataGrid>
            <My:MDataGrid x:Name="DataGrid3" ItemsSource="{Binding GridData3}" Visibility="Collapsed">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="CSXL(mm)" Binding="{Binding CSXL,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="CSYL(mm)" Binding="{Binding CSYL,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="CSZL(mm)" Binding="{Binding CSZL,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="记录时间" Binding="{Binding RecordTime,StringFormat=yyyy-MM-dd HH:mm:ss}"/>
                </DataGrid.Columns>
            </My:MDataGrid>
            <My:MDataGrid x:Name="DataGrid4" ItemsSource="{Binding GridData4}" Visibility="Collapsed">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="CSXR(mm)" Binding="{Binding CSXR,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.0001}"/>
                    <DataGridTextColumn Header="CSYR(mm)" Binding="{Binding CSYR,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.0001}"/>
                    <DataGridTextColumn Header="CSZR(度)" Binding="{Binding CSZR,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.00001}"/>
                    <DataGridTextColumn Header="记录时间" Binding="{Binding RecordTime,StringFormat=yyyy-MM-dd HH:mm:ss}"/>
                </DataGrid.Columns>
            </My:MDataGrid>
            <My:MDataGrid x:Name="DataGrid5" ItemsSource="{Binding GridData5}" Visibility="Collapsed">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="WSL(mm)" Binding="{Binding WSL,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="WSS(mm)" Binding="{Binding WSS,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="记录时间" Binding="{Binding RecordTime,StringFormat=yyyy-MM-dd HH:mm:ss}"/>
                </DataGrid.Columns>
            </My:MDataGrid>
            <My:MPagination x:Name="MyPagination" Grid.Row="1" PageIndexChange="MyPagination_PageIndexChange" PageSizeChange="MyPagination_PageSizeChange"/>
        </Grid>
        <Popup x:Name="PopupChart" StaysOpen="False" PlacementRectangle="10,100,0,0">
            <Border Background="White" BorderThickness="1" BorderBrush="{StaticResource DefaultBorderBrush}" Padding="10">
            </Border>
        </Popup>
    </Grid>
</Page>
