| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:base="clr-namespace:Muchinfo.DataPager.Base;assembly=Client.DataPager"
- xmlns:dataPager="clr-namespace:Muchinfo.DataPager;assembly=Client.DataPager">
- <!-- <SolidColorBrush x:Key="MainBrush" Color="#00FFFFFF" /> -->
- <!--
- <SolidColorBrush x:Key="AccentBrush" Color="#FF25A0DA" />
- <SolidColorBrush x:Key="StrongBrush" Color="#FF767676" />
- -->
- <ControlTemplate x:Key="PageButtonTemplate" TargetType="{x:Type base:MuchinfoPagerNavigationButton}">
- <Grid SnapsToDevicePixels="True">
- <Border Name="Border"
- Background="{TemplateBinding Control.Background}"
- BorderBrush="{TemplateBinding Control.BorderBrush}"
- BorderThickness="{TemplateBinding Control.BorderThickness}"
- CornerRadius="11" />
- <Grid Name="ContentGrid">
- <ContentPresenter Name="Content"
- HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
- Content="{TemplateBinding ContentControl.Content}"
- ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
- Opacity="0.5">
- <ContentPresenter.RenderTransform>
- <TransformGroup>
- <ScaleTransform />
- <SkewTransform />
- <RotateTransform />
- <TranslateTransform />
- </TransformGroup>
- </ContentPresenter.RenderTransform>
- </ContentPresenter>
- </Grid>
- <Border Name="CommonStatesWrapper">
- <Border Name="FocusVisual"
- BorderBrush="{DynamicResource ButtonBackground}"
- BorderThickness="1"
- CornerRadius="11"
- Opacity="0"
- Visibility="Collapsed" />
- </Border>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="UIElement.IsMouseOver" Value="True">
- <Setter TargetName="Border" Property="Border.Background" Value="{DynamicResource MouseOverBrush}" />
- <Setter TargetName="Content" Property="UIElement.Opacity" Value="1" />
- </Trigger>
- <Trigger Property="ButtonBase.IsPressed" Value="True">
- <Setter TargetName="Border" Property="Border.Background" Value="{DynamicResource MouseOverBrush}" />
- <Setter TargetName="Content" Property="UIElement.Opacity" Value="1" />
- <Setter TargetName="Content" Property="UIElement.RenderTransform">
- <Setter.Value>
- <TranslateTransform X="1" />
- </Setter.Value>
- </Setter>
- </Trigger>
- <Trigger Property="UIElement.IsEnabled" Value="False">
- <Setter TargetName="Content" Property="UIElement.Opacity" Value="0.3" />
- <Setter TargetName="Border" Property="UIElement.Opacity" Value="0.3" />
- </Trigger>
- <Trigger Property="UIElement.IsFocused" Value="True">
- <Setter TargetName="FocusVisual" Property="UIElement.Visibility" Value="Visible" />
- <Setter TargetName="FocusVisual" Property="UIElement.Opacity" Value="0.2" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- <Style x:Key="PageButtonStyle" TargetType="{x:Type base:MuchinfoPagerNavigationButton}">
- <Setter Property="Control.Template" Value="{StaticResource PageButtonTemplate}" />
- <Setter Property="Control.BorderBrush" Value="{DynamicResource MouseOverBrush}" />
- <Setter Property="Control.BorderThickness" Value="1" />
- <Setter Property="FrameworkElement.MinWidth" Value="22" />
- <Setter Property="FrameworkElement.MinHeight" Value="22" />
- <Setter Property="Control.HorizontalContentAlignment" Value="Center" />
- <Setter Property="Control.VerticalContentAlignment" Value="Center" />
- <Setter Property="FrameworkElement.Margin" Value="1,0" />
- </Style>
- <ControlTemplate x:Key="RadPageTemplate" TargetType="{x:Type base:MuchinfoPagerNumberRadioButton}">
- <Grid SnapsToDevicePixels="True">
- <Border Name="Border"
- Background="{TemplateBinding Control.Background}"
- BorderBrush="{TemplateBinding Control.BorderBrush}"
- BorderThickness="{TemplateBinding Control.BorderThickness}"
- CornerRadius="{TemplateBinding base:MuchinfoPagerNumberRadioButton.CornerRadius}" />
- <Border Name="CheckedVisual"
- Background="{DynamicResource MouseOverBrush}"
- BorderBrush="{TemplateBinding Control.BorderBrush}"
- BorderThickness="{TemplateBinding Control.BorderThickness}"
- CornerRadius="{TemplateBinding base:MuchinfoPagerNumberRadioButton.CornerRadius}"
- Opacity="0" />
- <Grid Name="ContentGrid">
- <ContentControl Name="Content"
- Margin="{TemplateBinding Control.Padding}"
- HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
- Content="{TemplateBinding ContentControl.Content}"
- ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
- Foreground="{TemplateBinding Control.Foreground}"
- IsTabStop="False">
- <ContentControl.RenderTransform>
- <TransformGroup>
- <ScaleTransform />
- <SkewTransform />
- <RotateTransform />
- <TranslateTransform />
- </TransformGroup>
- </ContentControl.RenderTransform>
- </ContentControl>
- </Grid>
- <Border Name="CommonStatesWrapper">
- <Border Name="FocusVisual"
- BorderBrush="{DynamicResource ButtonBackground}"
- BorderThickness="1"
- CornerRadius="{TemplateBinding base:MuchinfoPagerNumberRadioButton.CornerRadius}"
- Opacity="0"
- Visibility="Collapsed" />
- </Border>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="ToggleButton.IsChecked" Value="True">
- <Setter TargetName="CheckedVisual" Property="UIElement.Opacity" Value="1" />
- <!-- <Setter TargetName="Content" Property="Control.Foreground" Value="{StaticResource MainBrush}" /> -->
- </Trigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="UIElement.IsEnabled" Value="False" />
- <Condition Property="ToggleButton.IsChecked" Value="True" />
- </MultiTrigger.Conditions>
- <Setter TargetName="CheckedVisual" Property="UIElement.Opacity" Value="0" />
- <Setter TargetName="Content" Property="UIElement.Opacity" Value="0.5" />
- </MultiTrigger>
- <Trigger Property="UIElement.IsMouseOver" Value="True">
- <Setter TargetName="Border" Property="Border.Background" Value="{DynamicResource MouseOverBrush}" />
- </Trigger>
- <Trigger Property="ButtonBase.IsPressed" Value="True">
- <Setter TargetName="CommonStatesWrapper" Property="UIElement.Opacity" Value="0" />
- <Setter TargetName="Border" Property="Border.Background" Value="{DynamicResource MouseOverBrush}" />
- <Setter TargetName="Content" Property="UIElement.RenderTransform">
- <Setter.Value>
- <TranslateTransform Y="1" />
- </Setter.Value>
- </Setter>
- </Trigger>
- <Trigger Property="UIElement.IsEnabled" Value="False">
- <Setter TargetName="Border" Property="UIElement.Opacity" Value="0.3" />
- <Setter TargetName="Content" Property="UIElement.Opacity" Value="0.3" />
- </Trigger>
- <Trigger Property="UIElement.IsFocused" Value="True">
- <Setter TargetName="FocusVisual" Property="UIElement.Visibility" Value="Visible" />
- <Setter TargetName="FocusVisual" Property="UIElement.Opacity" Value="0.2" />
- </Trigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="ToggleButton.IsChecked" Value="True" />
- <Condition Property="UIElement.IsMouseOver" Value="True" />
- <Condition Property="ButtonBase.IsPressed" Value="False" />
- </MultiTrigger.Conditions>
- <Setter TargetName="CheckedVisual" Property="Border.Background" Value="{DynamicResource MouseOverBrush}" />
- <!-- <Setter TargetName="Content" Property="Control.Foreground" Value="{StaticResource MainBrush}" /> -->
- </MultiTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- <Style x:Key="RadPageStyle" TargetType="{x:Type base:MuchinfoPagerNumberRadioButton}">
- <Setter Property="Control.Template" Value="{StaticResource RadPageTemplate}" />
- <Setter Property="Control.Foreground" Value="{DynamicResource MainForegroundBrush}" />
- <Setter Property="Control.BorderBrush" Value="#00FFFFFF" />
- <Setter Property="Control.BorderThickness" Value="0" />
- <Setter Property="FrameworkElement.MinWidth" Value="22" />
- <Setter Property="FrameworkElement.MinHeight" Value="22" />
- <Setter Property="base:MuchinfoPagerNumberRadioButton.CornerRadius" Value="11" />
- <Setter Property="Control.HorizontalContentAlignment" Value="Center" />
- <Setter Property="Control.VerticalContentAlignment" Value="Center" />
- <Setter Property="Control.Padding" Value="6,0" />
- <Setter Property="FrameworkElement.Margin" Value="1,0" />
- </Style>
- <ControlTemplate x:Key="MuchinfoNumericElementsPresenterTemplate" TargetType="{x:Type base:MuchinfoNumericElementsPresenter}">
- <ItemsControl ItemsSource="{Binding Elements}">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <VirtualizingStackPanel Orientation="Horizontal" />
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <base:MuchinfoPagerNumberRadioButton Command="{x:Static base:MuchinfoPagerCommands.MoveToPage}"
- CommandParameter="{Binding PageIndex}"
- Content="{Binding Content}"
- GroupName="{Binding GroupName}"
- IsChecked="{Binding IsCurrent,
- Mode=OneWay}"
- Style="{Binding NumericButtonStyle}" />
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ControlTemplate>
- <Style TargetType="{x:Type base:MuchinfoNumericElementsPresenter}">
- <Setter Property="Control.Template" Value="{StaticResource MuchinfoNumericElementsPresenterTemplate}" />
- <Setter Property="UIElement.SnapsToDevicePixels" Value="True" />
- </Style>
- <ControlTemplate x:Key="MuchinfoDataPagerPresenterTemplate" TargetType="{x:Type base:MuchinfoPagerPresenter}">
- <Border Background="{TemplateBinding Control.Background}"
- BorderBrush="{TemplateBinding Control.BorderBrush}"
- BorderThickness="{TemplateBinding Control.BorderThickness}">
- <Grid HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <StackPanel Margin="2,0,0,0"
- HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
- Orientation="Horizontal">
- <base:MuchinfoPagerNavigationButton Name="MoveToFirstPageButton"
- Command="{x:Static base:MuchinfoPagerCommands.MoveToFirstPage}"
- RenderTransformOrigin="0.5,0.5"
- Style="{StaticResource PageButtonStyle}">
- <!--
- Visibility="{Binding PagerControlsVisibility.MoveToFirstPageControlVisibility,
- RelativeSource={RelativeSource TemplatedParent}}">
- -->
- <Path Width="12"
- Height="8"
- Data="M3.5,0.99999994L7,4 0,4z M0,0L7,0 7,0.99999994 3.5,0.99999994 0,0.99999994z"
- Fill="{DynamicResource ButtonBackground}"
- RenderTransformOrigin="0.5,0.5"
- Stretch="Fill">
- <Path.RenderTransform>
- <TransformGroup>
- <ScaleTransform />
- <SkewTransform />
- <RotateTransform Angle="90" />
- <TranslateTransform />
- </TransformGroup>
- </Path.RenderTransform>
- </Path>
- <base:MuchinfoPagerNavigationButton.RenderTransform>
- <TransformGroup>
- <ScaleTransform ScaleX="-1" />
- <SkewTransform />
- <RotateTransform />
- <TranslateTransform />
- </TransformGroup>
- </base:MuchinfoPagerNavigationButton.RenderTransform>
- </base:MuchinfoPagerNavigationButton>
- <base:MuchinfoPagerNavigationButton Name="MoveToPreviousPageButton"
- Command="{x:Static base:MuchinfoPagerCommands.MoveToPreviousPage}"
- RenderTransformOrigin="0.5,0.5"
- Style="{StaticResource PageButtonStyle}">
- <!--
- Visibility="{Binding PagerControlsVisibility.MoveToPreviousPageControlVisibility,
- RelativeSource={RelativeSource TemplatedParent}}"
- -->
- <Path Width="9"
- Height="12"
- Margin="2,0,0,0"
- Data="M0,0L9,6 0,12z"
- Fill="{DynamicResource ButtonBackground}"
- RenderTransformOrigin="0.5,0.5"
- Stretch="Fill" />
- <base:MuchinfoPagerNavigationButton.RenderTransform>
- <TransformGroup>
- <ScaleTransform ScaleX="-1" />
- <SkewTransform />
- <RotateTransform />
- <TranslateTransform />
- </TransformGroup>
- </base:MuchinfoPagerNavigationButton.RenderTransform>
- </base:MuchinfoPagerNavigationButton>
- <Border Height="22" VerticalAlignment="Center">
- <!--
- Visibility="{Binding PagerControlsVisibility.NumericElementsControlVisibility,
- RelativeSource={RelativeSource TemplatedParent}}">
- -->
- <base:MuchinfoNumericElementsPresenter NumericButtonCount="{TemplateBinding base:MuchinfoPagerPresenter.NumericButtonCount}"
- NumericButtonStyle="{TemplateBinding base:MuchinfoPagerPresenter.NumericButtonStyle}"
- PageCount="{TemplateBinding base:MuchinfoPagerPresenter.PageCount}"
- PageIndex="{TemplateBinding base:MuchinfoPagerPresenter.PageIndex}" />
- </Border>
- <base:MuchinfoPagerNavigationButton Name="MoveToNextPageButton"
- Command="{x:Static base:MuchinfoPagerCommands.MoveToNextPage}"
- Style="{StaticResource PageButtonStyle}">
- <!--
- Visibility="{Binding PagerControlsVisibility.MoveToNextPageControlVisibility,
- RelativeSource={RelativeSource TemplatedParent}}">
- -->
- <Path Width="9"
- Height="12"
- Margin="2,0,0,0"
- Data="M0,0L9,6 0,12z"
- Fill="{DynamicResource ButtonBackground}"
- RenderTransformOrigin="0.5,0.5"
- Stretch="Fill" />
- </base:MuchinfoPagerNavigationButton>
- <base:MuchinfoPagerNavigationButton Name="MoveToLastPageButton"
- Command="{x:Static base:MuchinfoPagerCommands.MoveToLastPage}"
- Style="{StaticResource PageButtonStyle}">
- <!--
- Visibility="{Binding PagerControlsVisibility.MoveToLastPageControlVisibility,
- RelativeSource={RelativeSource TemplatedParent}}">
- -->
- <Path Width="12"
- Height="8"
- Data="M3.5,0.99999994L7,4 0,4z M0,0L7,0 7,0.99999994 3.5,0.99999994 0,0.99999994z"
- Fill="{DynamicResource ButtonBackground}"
- RenderTransformOrigin="0.5,0.5"
- Stretch="Fill">
- <Path.RenderTransform>
- <TransformGroup>
- <ScaleTransform />
- <SkewTransform />
- <RotateTransform Angle="90" />
- <TranslateTransform />
- </TransformGroup>
- </Path.RenderTransform>
- </Path>
- </base:MuchinfoPagerNavigationButton>
- </StackPanel>
- <StackPanel Grid.Column="1"
- Margin="5,0"
- Orientation="Horizontal">
- <!--
- Visibility="{Binding PagerControlsVisibility.TextControlVisibility,
- RelativeSource={RelativeSource TemplatedParent}}">
- -->
- <!-- <TextBlock Margin="2,0" VerticalAlignment="Center" /> -->
- <base:MuchinfoPagerTextBox Height="20"
- MinWidth="30"
- MaxWidth="100"
- Margin="2,0"
- VerticalAlignment="Center"
- BorderThickness="1"
- Command="{x:Static base:MuchinfoPagerCommands.MoveToPage}"
- Style="{DynamicResource CommonTextBoxStyle}"
- PageIndex="{TemplateBinding base:MuchinfoPagerPresenter.PageIndex}" />
- <TextBlock Margin="2,0"
- VerticalAlignment="Center"
- Text="/" />
- <TextBlock Margin="2,0"
- VerticalAlignment="Center"
- Text="{Binding PageCount,
- RelativeSource={RelativeSource TemplatedParent}}" />
- </StackPanel>
- </Grid>
- </Border>
- </ControlTemplate>
- <Style TargetType="{x:Type base:MuchinfoPagerPresenter}">
- <Setter Property="Control.Template" Value="{StaticResource MuchinfoDataPagerPresenterTemplate}" />
- <Setter Property="SnapsToDevicePixels" Value="True" />
- </Style>
- <ControlTemplate x:Key="MuchinfoDataPagerTemplate" TargetType="{x:Type dataPager:MuchinfoPager}">
- <base:MuchinfoPagerPresenter HorizontalContentAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
- VerticalContentAlignment="{TemplateBinding Control.VerticalContentAlignment}"
- Background="{TemplateBinding Control.Background}"
- BorderBrush="{TemplateBinding Control.BorderBrush}"
- BorderThickness="{TemplateBinding Control.BorderThickness}"
- ItemCount="{Binding ItemCount,
- RelativeSource={RelativeSource TemplatedParent},
- Mode=TwoWay}"
- NumericButtonCount="{TemplateBinding dataPager:MuchinfoPager.NumericButtonCount}"
- NumericButtonStyle="{TemplateBinding dataPager:MuchinfoPager.NumericButtonStyle}"
- PageCount="{TemplateBinding dataPager:MuchinfoPager.PageCount}"
- PageSize="{Binding PageSize,
- RelativeSource={RelativeSource TemplatedParent},
- Mode=TwoWay}"
- PageIndex="{TemplateBinding dataPager:MuchinfoPager.PageIndex}" />
- </ControlTemplate>
- <Style x:Key="PagerStyle" TargetType="{x:Type dataPager:MuchinfoPager}">
- <Setter Property="Control.Template" Value="{StaticResource MuchinfoDataPagerTemplate}" />
- <Setter Property="Background" Value="#00FFFFFF" />
- <Setter Property="Control.Foreground" Value="{DynamicResource MainForegroundBrush}" />
- <Setter Property="Control.BorderBrush" Value="#00FFFFFF" />
- <Setter Property="Control.BorderThickness" Value="0" />
- <Setter Property="dataPager:MuchinfoPager.NumericButtonStyle" Value="{StaticResource RadPageStyle}" />
- <Setter Property="FrameworkElement.Height" Value="30" />
- <Setter Property="Control.HorizontalContentAlignment" Value="Stretch" />
- <Setter Property="Control.VerticalContentAlignment" Value="Center" />
- <Setter Property="FontFamily" Value="Simsun, Microsoft YaHei" />
- <Setter Property="Control.FontSize" Value="12" />
- <Setter Property="UIElement.SnapsToDevicePixels" Value="True" />
- </Style>
- </ResourceDictionary>
|