<Window x:Class="AIRS.HistoryGrade"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:AIRS"
        xmlns:local1="clr-namespace:AIRS.usercontrol"
        mc:Ignorable="d" xmlns:sys="clr-namespace:System;assembly=mscorlib"
        Title="FeildParam" Loaded="Window_Loaded"  WindowStyle="None" ContentRendered="Window_ContentRendered"  Background="#223754" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" Height="566" Width="898">
    <Grid>
        <!--<Border Canvas.Left="45" Canvas.Top="33" >
            <Image x:Name="imgS" Source="img/u115.png" Width="80" Height="80" Canvas.Left="45" Canvas.Top="33" RenderTransformOrigin="-0.44,0.61"></Image >
        </Border>-->
        <Label Content="历史评级" x:Name="HisorReport" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Foreground="White" FontSize="20" FontWeight="Bold"/>
        <Canvas Margin="0,38,-0.4,56.6" Background="#18253C" x:Name="HisGrad">
            <Label x:Name="lable1" Content="检测日期" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Foreground="White" FontSize="15" RenderTransformOrigin="0.783,0.906" Canvas.Top="10" Canvas.Left="10" />
            <DatePicker SelectedDate="{x:Static sys:DateTime.Now}"  x:Name="startdatePickerCtl" Width="200" Height="25"
            SelectedDateFormat="Long" FirstDayOfWeek="Monday"
            DisplayDateStart="1900/1/1" DisplayDateEnd="2099/12/31"
            IsTodayHighlighted="False" Canvas.Left="89" Canvas.Top="10" >
                <!--<DatePicker.BlackoutDates>
                    <CalendarDateRange Start="1900/1/1" End="2099/12/31"/>
                    <CalendarDateRange Start="1900/1/1" End="2099/12/31"/>
                </DatePicker.BlackoutDates>-->
            </DatePicker>
            <DatePicker SelectedDate="{x:Static sys:DateTime.Now}"  x:Name="enddatePickerCtl" Width="200" Height="25"
                SelectedDateFormat="Long" FirstDayOfWeek="Monday"
                DisplayDateStart="1900/1/1" DisplayDateEnd="2099/12/31"
                IsTodayHighlighted="False" Canvas.Left="323" Canvas.Top="10">
                <!--<DatePicker.BlackoutDates>
                    <CalendarDateRange Start="1900/1/1" End="2099/12/31"/>
                    <CalendarDateRange Start="1900/1/1" End="2099/12/31"/>
                </DatePicker.BlackoutDates>-->
            </DatePicker>

            <DataGrid LoadingRow="date_grid_LoadingRow" Name="date_grid" Grid.Column="0"  ItemsSource="{Binding}" RowHeaderWidth="0" CanUserAddRows="False" AutoGenerateColumns="False" Canvas.Left="10" Canvas.Top="59" Height="351" Width="878">
                <DataGrid.Columns>
                    <DataGridTemplateColumn   Width="50" Header="序号" IsReadOnly="True">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0"></TextBlock>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTextColumn Width="80" Header="检测项目" Binding="{Binding gradeproject}" IsReadOnly="True"/>
                    <DataGridTextColumn Width="100" Header="检测时间" Binding="{Binding gradetime}" IsReadOnly="True"/>
                    <DataGridTextColumn Width="80" Header="类别" Binding="{Binding catagory}" IsReadOnly="True"/>
                    <DataGridTextColumn Width="80" Header="钢种" Binding="{Binding gangzhong}" IsReadOnly="True"/>
                    <DataGridTextColumn Width="80" Header="图像数量" Binding="{Binding imgcount}" IsReadOnly="True"/>
                    <DataGridTextColumn Width="80" Header="评级标准" Binding="{Binding pingji}" IsReadOnly="True"/>
                    <DataGridTextColumn Width="80" Header="检测仪器" Binding="{Binding instrument}" IsReadOnly="True"/>
                    <DataGridTextColumn Width="80" Header="检测员" Binding="{Binding operation}" IsReadOnly="True"/>
                    <DataGridTextColumn Width="80" Header="复核员" Binding="{Binding checke}" IsReadOnly="True"/>
                    <DataGridTemplateColumn Width="80" Header="查看报告" IsReadOnly="True">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
                                    <Button Content="查看报告" Tag="{Binding imgurl}" Click="Button_Click" >

                                        <Button.Template>
                                            <ControlTemplate TargetType="Button">
                                                <TextBlock TextDecorations="Underline"> <ContentPresenter /></TextBlock>
                                            </ControlTemplate>
                                        </Button.Template>
                                        <Button.Style>
                                            <Style TargetType="Button">
                                                <Setter Property="Foreground" Value="Blue" />
                                                <Style.Triggers>
                                                    <Trigger Property="IsMouseOver" Value="true">
                                                        <Setter Property="Foreground" Value="Red" />
                                                    </Trigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Button.Style>

                                    </Button>
                                </StackPanel>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                </DataGrid.Columns>
                <DataGrid.RowStyle >
                    <Style TargetType="DataGridRow">
                        <Setter Property="Background" Value="White"/>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="LightGray"/>
                            </Trigger>
                            <Trigger Property="IsSelected" Value="True">
                                <!--<Setter Property="Background" Value="#90F670"/>-->
                                <Setter Property="Foreground" Value="White"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </DataGrid.RowStyle>

            </DataGrid>

        </Canvas>

        <Canvas Margin="0,38,-0.4,56.6" Background="#18253C" x:Name="CheckReport" Visibility="Collapsed">
            <Viewbox Stretch="Fill" Width="40" Canvas.Left="187" Canvas.Top="15" >
                <local1:Report x:Name="pbw" Width="83" Height="605"></local1:Report>
            </Viewbox>
        </Canvas>

        <Button x:Name="btnCancel" Click="btnCancel_Click"  Content="关闭" HorizontalAlignment="Left" Margin="740,519,0,0" VerticalAlignment="Top" Width="138" Height="37" FontSize="20" Foreground="White" Background="#FF169BD5" RenderTransformOrigin="0.949,1.55">
            <Button.Template >
                <ControlTemplate TargetType="{x:Type Button}" >
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="7,7,7,7">
                        <Border.Background>
                            <Brush>#FF169BD5</Brush>
                        </Border.Background>
                        <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                    </Border>
                </ControlTemplate>
            </Button.Template>
        </Button>
        <Button x:Name="btn_Query" Content="查询" Click="btn_Query_Click"  HorizontalAlignment="Left" Margin="543,46,0,0" VerticalAlignment="Top" Width="63" Height="30" FontSize="20" Foreground="White" Background="#FF169BD5">
            <Button.Template >
                <ControlTemplate TargetType="{x:Type Button}" >
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="7,7,7,7">
                        <Border.Background>
                            <Brush>#FF169BD5</Brush>
                        </Border.Background>
                        <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                    </Border>
                </ControlTemplate>
            </Button.Template>
        </Button>
        <Button x:Name="CheckBtnSave" Content="报告另存" Visibility="Collapsed" HorizontalAlignment="Left" Margin="543,509,0,0" VerticalAlignment="Top" Width="138" Height="37" FontSize="20" Foreground="White" Background="#FF169BD5" RenderTransformOrigin="-0.696,0.55">
            <Button.Template >
                <ControlTemplate TargetType="{x:Type Button}" >
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="7,7,7,7">
                        <Border.Background>
                            <Brush>#FF169BD5</Brush>
                        </Border.Background>
                        <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                    </Border>
                </ControlTemplate>
            </Button.Template>
        </Button>
        <local1:PageNumControl x:Name="pageuser" Width="680" HorizontalAlignment="Left" Margin="218,451,0,57"/>
        <!--<Button x:Name="pro_btn" Content="上一页" Click="pro_btn_Click" HorizontalAlignment="Left" Margin="638,463,0,0" VerticalAlignment="Top" Width="77" Height="31" FontSize="20" Foreground="White" Background="#FF169BD5" RenderTransformOrigin="0.949,1.55">
            <Button.Template >
                <ControlTemplate TargetType="{x:Type Button}" >
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="7,7,7,7">
                        <Border.Background>
                            <Brush>#FF169BD5</Brush>
                        </Border.Background>
                        <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                    </Border>
                </ControlTemplate>
            </Button.Template>
        </Button>
        <Button Content="首页" x:Name="first_btn" Click="first_btn_Click" HorizontalAlignment="Left" Margin="557,463,0,0" VerticalAlignment="Top" Width="77" Height="31" FontSize="20" Foreground="White" Background="#FF169BD5" RenderTransformOrigin="0.949,1.55">
            <Button.Template >
                <ControlTemplate TargetType="{x:Type Button}" >
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="7,7,7,7">
                        <Border.Background>
                            <Brush>#FF169BD5</Brush>
                        </Border.Background>
                        <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                    </Border>
                </ControlTemplate>
            </Button.Template>
        </Button>
        <Button Content="下一页" x:Name="next_btn" Click="next_btn_Click" HorizontalAlignment="Left" Margin="720,463,0,0" VerticalAlignment="Top" Width="77" Height="31" FontSize="20" Foreground="White" Background="#FF169BD5" RenderTransformOrigin="0.949,1.55">
            <Button.Template >
                <ControlTemplate TargetType="{x:Type Button}" >
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="7,7,7,7">
                        <Border.Background>
                            <Brush>#FF169BD5</Brush>
                        </Border.Background>
                        <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                    </Border>
                </ControlTemplate>
            </Button.Template>
        </Button>
        <Button Content="尾页" x:Name="last_btn" Click="last_btn_Click" HorizontalAlignment="Left" Margin="801,463,0,0" VerticalAlignment="Top" Width="77" Height="31" FontSize="20" Foreground="White" Background="#FF169BD5" RenderTransformOrigin="0.949,1.55">
            <Button.Template >
                <ControlTemplate TargetType="{x:Type Button}" >
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="7,7,7,7">
                        <Border.Background>
                            <Brush>#FF169BD5</Brush>
                        </Border.Background>
                        <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                    </Border>
                </ControlTemplate>
            </Button.Template>
        </Button>-->

    </Grid>
</Window>
