<Page x:Class="CCDCountWpf.WpfPage.HistoryDataPage"
      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:CCDCountWpf.WpfPage"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
      Title="HistoryDataPage">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="60"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="60"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Label Content="日期筛选:" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,0,0,0" />
            <DatePicker x:Name="BatchNumRecordMinTime" Width="120" Height="25"  HorizontalAlignment="Left" VerticalAlignment="Center" SelectedDateChanged="BatchNumRecordMinTime_SelectedDateChanged" Margin="65,0,0,0"/>
            <Label Content="-" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="190,0,0,0" />
            <DatePicker x:Name="BatchNumRecordMaxTime" Width="120" Height="25"  HorizontalAlignment="Left" Margin="210,0,0,0" VerticalAlignment="Center" SelectedDateChanged="BatchNumRecordMaxTime_SelectedDateChanged"/>
            <Label Content="批次选择:" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,200,0" />
            <ComboBox Grid.Row="0" x:Name="BatchNumComBox" ItemsSource="{Binding BatchItems}" MaxDropDownHeight="100" Background="{x:Null}" HorizontalAlignment="Right" VerticalAlignment="Center" Height="30" Width="180" FontSize="12" HorizontalContentAlignment="Center" Padding="6,6,5,3" Margin="0,0,10,0" SelectionChanged="BatchNumRecordComBox_SelectionChanged"/>
        </Grid>
        <Border Grid.Row="1" BorderBrush="Black" BorderThickness="1" Margin="2,2,2,2">
            <Image x:Name="ShowBox" Source="{Binding HistoryImage}" Margin="0,0,0,0"/>
        </Border>
        <Border x:Name="PageChangeBorder" Grid.Row="2" Margin="2,2,2,2" VerticalAlignment="Center" HorizontalAlignment="Center" Background="#FF0087FF" 
                    CornerRadius="8"
                    BorderBrush="Gray"
                    BorderThickness="1">
            <StackPanel Orientation="Horizontal">
                <Button x:Name="PreviousBtn" Content="上一张" Height="40" Width="100" Margin="30,5,30,5" Click="PreviousBtn_Click" Padding="1,1,1,1" VerticalAlignment="Center" BorderThickness="1" Background="#FF0123FF" Foreground="White" Cursor="Hand">
                    <Button.Template>
                        <ControlTemplate TargetType="Button">
                            <Border CornerRadius="5"  Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"  BorderThickness="{TemplateBinding BorderThickness}">
                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </Border>
                        </ControlTemplate>
                    </Button.Template>
                </Button>              
                <Label Content="第" FontSize="20" VerticalAlignment="Center" Foreground="White" />
                <Label Content="{Binding HistoryImageNum}" FontSize="20" VerticalAlignment="Center" Foreground="White" />
                <Label Content="张/共" FontSize="20" VerticalAlignment="Center" Foreground="White" />
                <Label Content="{Binding HistoryImageCount}" FontSize="20" VerticalAlignment="Center" Foreground="White" />
                <Label Content="张" FontSize="20" Margin="0,0,20,0" VerticalAlignment="Center" Foreground="White" />
                <Label Content="跳转至" FontSize="20" VerticalAlignment="Center" Foreground="White" />
                <TextBox x:Name="NowPageNumTbx" Text="{Binding HistoryImageNum}"  Height="40" Width="50" FontSize="20" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" VerticalAlignment="Center" Background="{x:Null}" Foreground="White" />
                <Label Content="张" FontSize="20" Margin="0,0,5,0" VerticalAlignment="Center" Foreground="White" />
                <Button x:Name="SkipBtn" Content="跳转" Height="30" Width="50" Margin="0,0,0,0" Click="SkipBtn_Click" VerticalAlignment="Center" BorderThickness="1" Background="#FF0123FF" Foreground="White" Cursor="Hand">
                    <Button.Template>
                        <ControlTemplate TargetType="Button">
                            <Border CornerRadius="5"  Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"  BorderThickness="{TemplateBinding BorderThickness}">
                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </Border>
                        </ControlTemplate>
                    </Button.Template>
                </Button>
                <Button x:Name="NextBtn" Content="下一张" Height="40" Width="100" Margin="30,0,30,0" Click="NextBtn_Click" VerticalAlignment="Center" BorderThickness="1" Background="#FF0123FF" Foreground="White" Cursor="Hand">
                    <Button.Template>
                        <ControlTemplate TargetType="Button">
                            <Border CornerRadius="5"  Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"  BorderThickness="{TemplateBinding BorderThickness}">
                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </Border>
                        </ControlTemplate>
                    </Button.Template>
                </Button>
            </StackPanel>
        </Border>
    </Grid>
</Page>
