样式demo
This commit is contained in:
@@ -6,9 +6,10 @@
|
||||
xmlns:converters="clr-namespace:NeoUI.Converters"
|
||||
xmlns:decorations="clr-namespace:NeoUI.Controls.Decorations">
|
||||
|
||||
<!--<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/NeuWPF;component/Controls/ButtonsStyle.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>-->
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/NeoUI;component/Controls/ComboBox.xaml" />
|
||||
<ResourceDictionary Source="/NeoUI;component/Controls/TextBox.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<!-- 页码按钮的样式 -->
|
||||
<Style x:Key="EmbossPaginationButtonStyle" TargetType="Button">
|
||||
@@ -154,6 +155,64 @@
|
||||
</Style>
|
||||
|
||||
<!-- PaginationControl 的主模板 -->
|
||||
<Style x:Key="EmbossPaginationStyle" TargetType="{x:Type controls:Pagination}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:Pagination}">
|
||||
<StackPanel VerticalAlignment="Center" Orientation="Horizontal">
|
||||
<!-- 页码按钮列表 -->
|
||||
<ItemsControl ItemsSource="{Binding PageItems, RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type controls:PageItem}">
|
||||
<Button
|
||||
Content="{Binding Text}"
|
||||
IsEnabled="{Binding IsEnabled}"
|
||||
Style="{StaticResource EmbossPaginationButtonStyle}"
|
||||
ToolTip="{Binding ToolTip}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
<!-- 页面尺寸选择器 -->
|
||||
<ComboBox
|
||||
Margin="8,0,0,0"
|
||||
ItemsSource="{Binding PageSizeOptions, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
SelectedItem="{Binding PageSize, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
||||
Style="{StaticResource FloatComboBoxStyle}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding StringFormat={}{0} 条/页}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<!-- 跳转输入框 -->
|
||||
<StackPanel
|
||||
Margin="8,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{Binding ShowPageInput, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static converters:BooleanToVisibilityConverter.CollapsedInstance}}">
|
||||
<TextBlock VerticalAlignment="Center" Text="跳至" />
|
||||
<TextBox
|
||||
x:Name="PART_PageInputTextBox"
|
||||
Width="50"
|
||||
Margin="4,0"
|
||||
HorizontalContentAlignment="Center"
|
||||
Style="{StaticResource SlotTextBoxStyle}"
|
||||
Text="{Binding CurrentPage, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" />
|
||||
<TextBlock VerticalAlignment="Center" Text="页" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type controls:Pagination}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
|
||||
Reference in New Issue
Block a user