<UserControl x:Class="AIRS.usercontrol.Page_UserControl1"
             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:AIRS.usercontrol"
             mc:Ignorable="d" 
             d:DesignHeight="660" d:DesignWidth="1350" Background="#FF18253C" Loaded="UserControl_Loaded">
    <Grid Margin="0,0,0,10">
        <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" Margin="10,55,10,65" RenderTransformOrigin="0.5,0.5" >
            <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="400" Header="用户名" Binding="{Binding username}" IsReadOnly="True"/>
                <DataGridTextColumn Width="400" Header="密码" Binding="{Binding password}" IsReadOnly="True"/>
                <DataGridTemplateColumn Width="400" Header="操作" IsReadOnly="True">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
                                <Button Content="修改用户" Tag="{Binding username}" 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="Black" />
                                                </Trigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Button.Style>

                                </Button>

                                <Button Margin="10 0 0 0" Content="删除用户" Tag="{Binding username}" Click="Button_Click_1" >
                                    <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="Black" />
                                                </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>
        <!--<Button x:Name="pro_btn" Content="上一页" Click="pro_btn_Click" HorizontalAlignment="Left" Margin="1100,556,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="1019,556,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="1182,556,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="1263,556,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="btn_add" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="87" Height="40" FontSize="20" Foreground="White" Background="#FF169BD5" RenderTransformOrigin="0.949,1.55" Click="btn_add_Click">
            <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="btn_query_Copy" HorizontalAlignment="Left" Margin="102,10,0,0" VerticalAlignment="Top" Width="87" Height="40" FontSize="20" Foreground="White" Background="#FF169BD5" RenderTransformOrigin="0.949,1.55" Click="btn_query_Copy_Click">
            <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>

        <local:PageNumControl x:Name="pageuser" Width="679" HorizontalAlignment="Left" Canvas.Top="140" Canvas.Left="0" Margin="671,563,0,10"/>

    </Grid>
</UserControl>
