整理代码
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<!-- 文件路径: /Themes/Generic.xaml -->
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:Melskin.Controls"
|
||||
xmlns:converters="clr-namespace:Melskin.Converters"
|
||||
xmlns:decorations="clr-namespace:Melskin.Controls.Decorations"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:decorations="clr-namespace:Melskin.Controls.Decorations">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/Melskin;component/Controls/ComboBox.xaml" />
|
||||
@@ -12,7 +12,7 @@
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<!-- 页码按钮的样式 -->
|
||||
<Style TargetType="Button" x:Key="EmbossPaginationButtonStyle">
|
||||
<Style x:Key="EmbossPaginationButtonStyle" TargetType="Button">
|
||||
<Setter Property="MinWidth" Value="32" />
|
||||
<Setter Property="Height" Value="32" />
|
||||
<Setter Property="Margin" Value="2,0" />
|
||||
@@ -27,22 +27,22 @@
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Grid>
|
||||
<decorations:EmbossBorder
|
||||
x:Name="emboss"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="4"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Intensity="0.4"
|
||||
x:Name="emboss" />
|
||||
Intensity="0.4" />
|
||||
<decorations:SlotBorder
|
||||
x:Name="slot"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="4"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Intensity=".4"
|
||||
Visibility="Collapsed"
|
||||
x:Name="slot" />
|
||||
Visibility="Collapsed" />
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
@@ -54,8 +54,8 @@
|
||||
<Binding Path="CurrentPage" RelativeSource="{RelativeSource AncestorType=controls:Pagination}" />
|
||||
</MultiBinding>
|
||||
</DataTrigger.Binding>
|
||||
<Setter Property="Visibility" TargetName="emboss" Value="Collapsed" />
|
||||
<Setter Property="Visibility" TargetName="slot" Value="Visible" />
|
||||
<Setter TargetName="emboss" Property="Visibility" Value="Collapsed" />
|
||||
<Setter TargetName="slot" Property="Visibility" Value="Visible" />
|
||||
</DataTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
@@ -88,7 +88,7 @@
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<Style TargetType="Button" x:Key="PaginationButtonStyle">
|
||||
<Style x:Key="PaginationButtonStyle" TargetType="Button">
|
||||
<Setter Property="MinWidth" Value="34" />
|
||||
<Setter Property="MinHeight" Value="34" />
|
||||
<Setter Property="Margin" Value="2,0" />
|
||||
@@ -103,11 +103,11 @@
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Grid>
|
||||
<Border
|
||||
x:Name="Border"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="4"
|
||||
x:Name="Border" />
|
||||
CornerRadius="4" />
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
@@ -122,7 +122,7 @@
|
||||
</DataTrigger.Binding>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryNormalBrush}" />
|
||||
|
||||
<Setter Property="Background" TargetName="Border" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
|
||||
<Setter TargetName="Border" Property="Background" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
|
||||
</DataTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
@@ -155,11 +155,11 @@
|
||||
</Style>
|
||||
|
||||
<!-- PaginationControl 的主模板 -->
|
||||
<Style TargetType="{x:Type controls:Pagination}" x:Key="EmbossPaginationStyle">
|
||||
<Style x:Key="EmbossPaginationStyle" TargetType="{x:Type controls:Pagination}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:Pagination}">
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<StackPanel VerticalAlignment="Center" Orientation="Horizontal">
|
||||
<!-- 页码按钮列表 -->
|
||||
<ItemsControl ItemsSource="{Binding PageItems, RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
@@ -180,8 +180,8 @@
|
||||
|
||||
<!-- 页面尺寸选择器 -->
|
||||
<ComboBox
|
||||
ItemsSource="{Binding PageSizeOptions, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Margin="8,0,0,0"
|
||||
ItemsSource="{Binding PageSizeOptions, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
SelectedItem="{Binding PageSize, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
||||
Style="{StaticResource FloatComboBoxStyle}">
|
||||
<ComboBox.ItemTemplate>
|
||||
@@ -194,18 +194,18 @@
|
||||
<!-- 跳转输入框 -->
|
||||
<StackPanel
|
||||
Margin="8,0,0,0"
|
||||
Orientation="Horizontal"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{Binding ShowPageInput, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static converters:BooleanToVisibilityConverter.CollapsedInstance}}">
|
||||
<TextBlock Text="跳至" VerticalAlignment="Center" />
|
||||
<TextBlock VerticalAlignment="Center" Text="跳至" />
|
||||
<TextBox
|
||||
HorizontalContentAlignment="Center"
|
||||
Margin="4,0"
|
||||
Style="{StaticResource SlotTextBoxStyle}"
|
||||
Text="{Binding CurrentPage, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
|
||||
x:Name="PART_PageInputTextBox"
|
||||
Width="50"
|
||||
x:Name="PART_PageInputTextBox" />
|
||||
<TextBlock Text="页" VerticalAlignment="Center" />
|
||||
Margin="4,0"
|
||||
HorizontalContentAlignment="Center"
|
||||
Style="{StaticResource SlotTextBoxStyle}"
|
||||
Text="{Binding CurrentPage, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" />
|
||||
<TextBlock VerticalAlignment="Center" Text="页" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ControlTemplate>
|
||||
@@ -217,7 +217,7 @@
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:Pagination}">
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<StackPanel VerticalAlignment="Center" Orientation="Horizontal">
|
||||
<!-- 页码按钮列表 -->
|
||||
<ItemsControl ItemsSource="{Binding PageItems, RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
@@ -238,10 +238,10 @@
|
||||
|
||||
<!-- 页面尺寸选择器 -->
|
||||
<ComboBox
|
||||
ItemsSource="{Binding PageSizeOptions, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Margin="8,0,0,0"
|
||||
SelectedItem="{Binding PageSize, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
||||
VerticalContentAlignment="Center">
|
||||
VerticalContentAlignment="Center"
|
||||
ItemsSource="{Binding PageSizeOptions, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
SelectedItem="{Binding PageSize, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding StringFormat={}{0} 条/页}" />
|
||||
@@ -252,18 +252,18 @@
|
||||
<!-- 跳转输入框 -->
|
||||
<StackPanel
|
||||
Margin="8,0,0,0"
|
||||
Orientation="Horizontal"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{Binding ShowPageInput, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static converters:BooleanToVisibilityConverter.CollapsedInstance}}">
|
||||
<TextBlock Text="跳至" VerticalAlignment="Center" />
|
||||
<TextBlock VerticalAlignment="Center" Text="跳至" />
|
||||
<TextBox
|
||||
HorizontalContentAlignment="Center"
|
||||
Margin="4,0"
|
||||
Text="{Binding CurrentPage, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
|
||||
VerticalContentAlignment="Center"
|
||||
x:Name="PART_PageInputTextBox"
|
||||
Width="50"
|
||||
x:Name="PART_PageInputTextBox" />
|
||||
<TextBlock Text="页" VerticalAlignment="Center" />
|
||||
Margin="4,0"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Text="{Binding CurrentPage, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" />
|
||||
<TextBlock VerticalAlignment="Center" Text="页" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ControlTemplate>
|
||||
|
||||
Reference in New Issue
Block a user