<UserControl x:Class="NEIntelligentControl2.Views.Basic.InfoBar"
             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:NEIntelligentControl2.Views.Basic"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <!--下一页-->
        <ControlTemplate x:Key="btlast">
            <Viewbox Width="17" Height="17">
                <Canvas Width="1024" Height="1024">
                    <Path x:Name="p1" Data="M736 512v0.3L288 960V64z" Fill="#FF497CAD"/>
                </Canvas>
            </Viewbox>
        </ControlTemplate>
        <!--最后一页-->
        <ControlTemplate x:Key="btlatest">
            <Viewbox Width="17" Height="17">
                <Canvas Width="1024" Height="1024">
                    <Path x:Name="p1" Data="M704 64h224v896H704zM544.3 512v0.3L96 960V64z" Fill="#FF497CAD"/>
                </Canvas>
            </Viewbox>
        </ControlTemplate>
        <!--上一页-->
        <ControlTemplate x:Key="btprevious">
            <Viewbox Width="17" Height="17">
                <Canvas Width="1024" Height="1024">
                    <Path x:Name="p1" Data="M288 512v0.3L736 960V64z" Fill="#FF497CAD"/>
                </Canvas>
            </Viewbox>
        </ControlTemplate>
        <!--第一页-->
        <ControlTemplate x:Key="btfirst">
            <Viewbox Width="17" Height="17">
                <Canvas Width="1024" Height="1024">
                    <Path x:Name="p1" Data="M479.7 512v0.3L928 960V64zM96 64h224v896H96z" Fill="#FF497CAD"/>
                </Canvas>
            </Viewbox>
        </ControlTemplate>
    </UserControl.Resources>
    <StatusBar x:Name="_SBMain" Background="WhiteSmoke">
        <StatusBarItem>
            <StackPanel Orientation="Horizontal">
                <StackPanel.Style>
                    <Style TargetType="StackPanel">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Path=IsPagination}" Value="True">
                                <Setter Property="Visibility"  Value="Visible"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Path=IsPagination}" Value="False">
                                <Setter Property="Visibility"  Value="Collapsed"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </StackPanel.Style>

                <TextBlock Text="每页条数：" VerticalAlignment="Center" x:Name="_tbEachCountTitle"/>
                <TextBox MinWidth="30" Margin="0,0,5,0" VerticalAlignment="Center" Text="{Binding RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Path=EachPageCount}"/>

                <Button ToolTip="第一页" Margin="1,0" Click="Button_Click" Tag="first">
                    <Button.Content>
                        <ContentControl Template="{StaticResource btfirst}"/>
                    </Button.Content>
                </Button>
                <Button ToolTip="上一页" Margin="1,0" Click="Button_Click" Tag="previous">
                    <Button.Content>
                        <ContentControl Template="{StaticResource btprevious}"/>
                    </Button.Content>
                </Button>
                <TextBox MinWidth="30" VerticalAlignment="Center" Margin="1,0" Text="{Binding RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Path=PageIndex}"/>
                <TextBlock Text="/" VerticalAlignment="Center" Margin="1,0"/>
                <TextBlock MinWidth="30" VerticalAlignment="Center" Margin="1,0" Text="{Binding RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Path=PageCount}"/>
                <Button ToolTip="下一页" Margin="1,0" Click="Button_Click" Tag="last">
                    <Button.Content>
                        <ContentControl Template="{StaticResource btlast}"/>
                    </Button.Content>
                </Button>
                <Button ToolTip="最后一页" Margin="1,0" Click="Button_Click" Tag="latest">
                    <Button.Content>
                        <ContentControl Template="{StaticResource btlatest}"/>
                    </Button.Content>
                </Button>
            </StackPanel>
        </StatusBarItem>
        <StatusBarItem HorizontalAlignment="Right">
            <TextBlock x:Name="_TBStatus" Text="就绪" Foreground="WhiteSmoke"/>
        </StatusBarItem>
    </StatusBar>
</UserControl>
