<UserControl
             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:MWSDomain.Common.UserControls.Common"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:Converters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" x:Class="MWSDomain.Common.UserControls.Common.UcDataPager"
             mc:Ignorable="d" >
    <UserControl.Resources>
        <Style x:Key="ButtonStyle" TargetType="{x:Type Button}">
            <Setter Property="FocusVisualStyle">
                <Setter.Value>
                    <Style>
                        <Setter Property="Control.Template">
                            <Setter.Value>
                                <ControlTemplate>
                                    <Rectangle Margin="2" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </Setter.Value>
            </Setter>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="Foreground" Value="#5CACEE"/>
            <Setter Property="materialDesign:RippleAssist.Feedback" Value="White"/>
            <Setter Property="Cursor" Value="Hand"/>
            <Setter Property="materialDesign:ShadowAssist.ShadowDepth" Value="Depth2"/>
            <Setter Property="FontWeight" Value="Medium"/>
            <Setter Property="FontSize" Value="22"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Padding" Value="16,4"/>
            <Setter Property="Height" Value="32"/>
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="BorderBrush" Value="#C9C9C9"/>
            <Setter Property="FontFamily" Value="/Common/Fonts/#iconfont"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid>
                            <AdornerDecorator CacheMode="{Binding (materialDesign:ShadowAssist.CacheMode), RelativeSource={RelativeSource Self}}">
                                <Grid>
                                    <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0">
                                        <Border.Effect>
                                            <Binding Path="(materialDesign:ShadowAssist.ShadowDepth)" RelativeSource="{RelativeSource TemplatedParent}">
                                                <Binding.Converter>
                                                    <Converters:ShadowConverter/>
                                                </Binding.Converter>
                                            </Binding>
                                        </Border.Effect>
                                    </Border>
                                    <Border Background="{DynamicResource MaterialDesignBackground}" HorizontalAlignment="Left" Opacity="0.4">
                                        <Border.Width>
                                            <MultiBinding UpdateSourceTrigger="Default">
                                                <MultiBinding.Converter>
                                                    <Converters:RangeLengthConverter/>
                                                </MultiBinding.Converter>
                                                <Binding Path="(materialDesign:ButtonProgressAssist.Minimum)" RelativeSource="{RelativeSource TemplatedParent}"/>
                                                <Binding Path="(materialDesign:ButtonProgressAssist.Maximum)" RelativeSource="{RelativeSource TemplatedParent}"/>
                                                <Binding Path="(materialDesign:ButtonProgressAssist.Value)" RelativeSource="{RelativeSource TemplatedParent}"/>
                                                <Binding Path="ActualWidth" RelativeSource="{RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ButtonBase}}"/>
                                            </MultiBinding>
                                        </Border.Width>
                                    </Border>
                                </Grid>
                            </AdornerDecorator>
                            <materialDesign:Ripple ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Focusable="False" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="materialDesign:ShadowAssist.Darken" TargetName="border" Value="True"/>
                                <Setter Property="Foreground" Value="Red"/>
                            </Trigger>
                            <Trigger Property="IsKeyboardFocused" Value="True">
                                <Setter Property="materialDesign:ShadowAssist.Darken" TargetName="border" Value="True"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="Opacity" Value="0.23"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid>
        <Grid Height="40">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
                <TextBlock Text="共 " Margin="10 0 0 0"  Foreground="#737373"  FontSize="15" VerticalAlignment="Center" />
                <TextBlock Text="{Binding TotalCount}" Foreground="#5CACEE" FontSize="15" Margin="4,0" VerticalAlignment="Center"  />
                <TextBlock  Text=" 行，每页 "  Foreground="#737373"  FontSize="15" VerticalAlignment="Center"  />
                <TextBlock Text="{Binding PageSize}" Foreground="#5CACEE" FontSize="15" Margin="4,0" VerticalAlignment="Center"  />
                <TextBlock Text=" 行，当前 " Foreground="#737373"   FontSize="15" VerticalAlignment="Center"  />
                <TextBlock Text="{Binding PageIndex}" Foreground="#5CACEE"  FontSize="15"  Margin="4,0,2,0" VerticalAlignment="Center"  />
                <TextBlock Text=" / "   Foreground="#737373"  FontSize="15" VerticalAlignment="Center"  />
                <TextBlock Text="{Binding PageCount}" Foreground="#5CACEE"  FontSize="15"  Margin="4,0,2,0" VerticalAlignment="Center"  />
                <TextBlock Text="页 "  Foreground="#737373"   FontSize="15" VerticalAlignment="Center" Margin="2,0,0,0"  />

                <Button Command="{Binding GoHomePageCommand}" Background="Transparent" BorderThickness="0">
                    <materialDesign:PackIcon Kind="ArrowCollapseLeft"  Width="50"  Foreground="#5CACEE"  ToolTip="首页">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="MouseLeftButtonDown">
                                <i:InvokeCommandAction />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </materialDesign:PackIcon>
                </Button>

                <Button Command="{Binding GoOnPageCommand}" Background="Transparent" BorderThickness="0">
                    <materialDesign:PackIcon Kind="ArrowLeft" Width="50"  Foreground="#5CACEE"  ToolTip="上一页">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="MouseLeftButtonDown">
                                <i:InvokeCommandAction Command="{Binding GoOnPageCommand}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </materialDesign:PackIcon>
                </Button>

                <Button Command="{Binding GoNextPageCommand}" Background="Transparent" BorderThickness="0">
                    <materialDesign:PackIcon Kind="ArrowRight"  Width="50"  Foreground="#5CACEE" ToolTip="下一页">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="MouseLeftButtonDown">
                                <i:InvokeCommandAction Command="{Binding GoNextPageCommand}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </materialDesign:PackIcon>
                </Button>

                <Button Command="{Binding GoNextPageCommand}" Background="Transparent" BorderThickness="0">
                    <materialDesign:PackIcon Kind="ArrowCollapseRight" Width="50"  Foreground="#5CACEE"  ToolTip="尾页">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="MouseLeftButtonDown">
                                <i:InvokeCommandAction Command="{Binding GoEndPageCommand}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </materialDesign:PackIcon>
                </Button>
            </StackPanel>
        </Grid>
    </Grid>
</UserControl>
