184 lines
9.3 KiB
XML
184 lines
9.3 KiB
XML
<ResourceDictionary
|
|
xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:u="https://irihi.tech/ursa">
|
|
<Design.PreviewWith>
|
|
<StackPanel Margin="20">
|
|
<u:PaginationButton Page="3" />
|
|
</StackPanel>
|
|
</Design.PreviewWith>
|
|
<ControlTheme x:Key="{x:Type u:Pagination}" TargetType="u:Pagination">
|
|
<Setter Property="Template">
|
|
<ControlTemplate TargetType="u:Pagination">
|
|
<StackPanel Orientation="Horizontal">
|
|
<u:PaginationButton Name="{x:Static u:Pagination.PART_PreviousButton}" u:DisabledAdorner.IsEnabled="True">
|
|
<PathIcon
|
|
Theme="{StaticResource InnerPathIcon}"
|
|
Data="{DynamicResource PaginationBackwardGlyph}"
|
|
Foreground="{DynamicResource PaginationButtonIconForeground}" />
|
|
</u:PaginationButton>
|
|
<StackPanel Name="{x:Static u:Pagination.PART_ButtonPanel}" Orientation="Horizontal" />
|
|
<u:PaginationButton Name="{x:Static u:Pagination.PART_NextButton}" u:DisabledAdorner.IsEnabled="True">
|
|
<PathIcon
|
|
Theme="{StaticResource InnerPathIcon}"
|
|
Data="{DynamicResource PaginationForwardGlyph}"
|
|
Foreground="{DynamicResource PaginationButtonIconForeground}" />
|
|
</u:PaginationButton>
|
|
<StackPanel IsVisible="{TemplateBinding ShowQuickJump}" Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="4,0"
|
|
VerticalAlignment="Center"
|
|
Text="{DynamicResource STRING_PAGINATION_JUMP_TO}" />
|
|
<u:NumericIntUpDown
|
|
x:Name="{x:Static u:Pagination.PART_QuickJumpInput}"
|
|
Width="50"
|
|
ShowButtonSpinner="False" />
|
|
<TextBlock
|
|
Margin="4,0"
|
|
VerticalAlignment="Center"
|
|
Text="{DynamicResource STRING_PAGINATION_PAGE}" />
|
|
</StackPanel>
|
|
<ComboBox
|
|
IsVisible="{TemplateBinding ShowPageSizeSelector}"
|
|
ItemsSource="{TemplateBinding PageSizeOptions}"
|
|
SelectedItem="{TemplateBinding PageSize,
|
|
Mode=TwoWay}" />
|
|
</StackPanel>
|
|
</ControlTemplate>
|
|
</Setter>
|
|
</ControlTheme>
|
|
|
|
<ControlTheme x:Key="TinyPagination" TargetType="{x:Type u:Pagination}">
|
|
<Setter Property="DisplayCurrentPageInQuickJumper" Value="True" />
|
|
<Setter Property="Template">
|
|
<ControlTemplate TargetType="u:Pagination">
|
|
<StackPanel Orientation="Horizontal">
|
|
<u:PaginationButton Name="{x:Static u:Pagination.PART_PreviousButton}" u:DisabledAdorner.IsEnabled="True">
|
|
<PathIcon
|
|
Theme="{StaticResource InnerPathIcon}"
|
|
Data="{DynamicResource PaginationBackwardGlyph}"
|
|
Foreground="{DynamicResource PaginationButtonIconForeground}" />
|
|
</u:PaginationButton>
|
|
<Grid ColumnDefinitions="*, Auto, *">
|
|
<u:NumericIntUpDown
|
|
Name="{x:Static u:Pagination.PART_QuickJumpInput}"
|
|
Grid.Column="0"
|
|
MinWidth="{Binding $self.Bounds.Height}"
|
|
VerticalAlignment="Center"
|
|
HorizontalContentAlignment="Center"
|
|
ShowButtonSpinner="False"
|
|
IsVisible="True"
|
|
Value="{TemplateBinding CurrentPage,
|
|
Mode=TwoWay}" />
|
|
<TextBlock
|
|
Name="PART_PageTextBlock"
|
|
Grid.Column="0"
|
|
VerticalAlignment="Center"
|
|
IsVisible="False"
|
|
Text="{TemplateBinding CurrentPage}" />
|
|
<TextBlock
|
|
Grid.Column="1"
|
|
Margin="8,0"
|
|
VerticalAlignment="Center"
|
|
Text="/" />
|
|
<SelectableTextBlock
|
|
Grid.Column="2"
|
|
VerticalAlignment="Center"
|
|
Text="{TemplateBinding PageCount}" />
|
|
</Grid>
|
|
<u:PaginationButton Name="{x:Static u:Pagination.PART_NextButton}" u:DisabledAdorner.IsEnabled="True">
|
|
<PathIcon
|
|
Theme="{StaticResource InnerPathIcon}"
|
|
Data="{DynamicResource PaginationForwardGlyph}"
|
|
Foreground="{DynamicResource PaginationButtonIconForeground}" />
|
|
</u:PaginationButton>
|
|
</StackPanel>
|
|
</ControlTemplate>
|
|
</Setter>
|
|
<Style Selector="^.ReadOnly /template/ TextBlock#PART_PageTextBlock">
|
|
<Setter Property="IsVisible" Value="True" />
|
|
</Style>
|
|
<Style Selector="^.ReadOnly /template/ u|NumericUpDown#PART_QuickJumpInput">
|
|
<Setter Property="IsVisible" Value="False" />
|
|
</Style>
|
|
</ControlTheme>
|
|
|
|
<ControlTheme x:Key="{x:Type u:PaginationButton}" TargetType="u:PaginationButton">
|
|
<Setter Property="Content" Value="{Binding $self.Page}" />
|
|
<Setter Property="BorderBrush" Value="Transparent" />
|
|
<Setter Property="MinWidth" Value="32" />
|
|
<Setter Property="MinHeight" Value="32" />
|
|
<Setter Property="Background" Value="{DynamicResource PaginationButtonDefaultBackground}" />
|
|
<Setter Property="Foreground" Value="{DynamicResource PaginationButtonDefaultForeground}" />
|
|
<Setter Property="Cursor" Value="Hand" />
|
|
<Setter Property="Template">
|
|
<ControlTemplate TargetType="u:PaginationButton">
|
|
<Border
|
|
Padding="4"
|
|
Background="{TemplateBinding Background}"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="1"
|
|
CornerRadius="3">
|
|
<ContentPresenter
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Content="{TemplateBinding Content}"
|
|
FontWeight="{TemplateBinding FontWeight}"
|
|
Foreground="{TemplateBinding Foreground}" />
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter>
|
|
<Style Selector="^:pointerover">
|
|
<Setter Property="Background" Value="{DynamicResource PaginationButtonPointeroverBackground}" />
|
|
</Style>
|
|
<Style Selector="^:pressed">
|
|
<Setter Property="Background" Value="{DynamicResource PaginationButtonPressedBackground}" />
|
|
</Style>
|
|
<Style Selector="^:left">
|
|
<Setter Property="Content">
|
|
<Template>
|
|
<PathIcon
|
|
Theme="{StaticResource InnerPathIcon}"
|
|
Data="{DynamicResource PaginationMoreGlyph}"
|
|
Foreground="{DynamicResource PaginationButtonIconForeground}" />
|
|
</Template>
|
|
</Setter>
|
|
<Style Selector="^:pointerover">
|
|
<Setter Property="Content">
|
|
<Template>
|
|
<PathIcon
|
|
Theme="{StaticResource InnerPathIcon}"
|
|
Data="{DynamicResource PaginationFastBackwardGlyph}"
|
|
Foreground="{DynamicResource PaginationButtonIconForeground}" />
|
|
</Template>
|
|
</Setter>
|
|
</Style>
|
|
</Style>
|
|
<Style Selector="^:right">
|
|
<Setter Property="Content">
|
|
<Template>
|
|
<PathIcon
|
|
Theme="{StaticResource InnerPathIcon}"
|
|
Data="{DynamicResource PaginationMoreGlyph}"
|
|
Foreground="{DynamicResource PaginationButtonIconForeground}" />
|
|
</Template>
|
|
</Setter>
|
|
<Style Selector="^:pointerover">
|
|
<Setter Property="Content">
|
|
<Template>
|
|
<PathIcon
|
|
Theme="{StaticResource InnerPathIcon}"
|
|
Data="{DynamicResource PaginationFastForwardGlyph}"
|
|
Foreground="{DynamicResource PaginationButtonIconForeground}" />
|
|
</Template>
|
|
</Setter>
|
|
</Style>
|
|
</Style>
|
|
<Style Selector="^:selected">
|
|
<Setter Property="Background" Value="{DynamicResource PaginationButtonSelectedBackground}" />
|
|
<Setter Property="Foreground" Value="{DynamicResource PaginationButtonSelectedForeground}" />
|
|
<Setter Property="FontWeight" Value="{DynamicResource TextBlockTitleFontWeight}" />
|
|
</Style>
|
|
</ControlTheme>
|
|
|
|
</ResourceDictionary> |