feat: add readonly mode.

This commit is contained in:
rabbitism
2024-08-10 01:00:30 +08:00
parent d8740e540b
commit 69f72238a6

View File

@@ -75,11 +75,13 @@
</u:PaginationButton> </u:PaginationButton>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<u:NumericIntUpDown <u:NumericIntUpDown
Name="PART_PageInput"
Value="{TemplateBinding CurrentPage, Mode=TwoWay}" Value="{TemplateBinding CurrentPage, Mode=TwoWay}"
ShowButtonSpinner="False" ShowButtonSpinner="False"
HorizontalContentAlignment="Center" HorizontalContentAlignment="Center"
MinWidth="{Binding $self.Bounds.Height}" MinWidth="{Binding $self.Bounds.Height}"
VerticalAlignment="Center" /> VerticalAlignment="Center" />
<TextBlock Name="PART_PageTextBlock" Text="{TemplateBinding CurrentPage}" VerticalAlignment="Center" IsVisible="False"/>
<TextBlock Text="/" <TextBlock Text="/"
Margin="8 0" Margin="8 0"
VerticalAlignment="Center" /> VerticalAlignment="Center" />
@@ -99,6 +101,12 @@
</StackPanel> </StackPanel>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^.ReadOnly /template/ TextBlock#PART_PageTextBlock">
<Setter Property="IsVisible" Value="True"></Setter>
</Style>
<Style Selector="^.ReadOnly /template/ u|NumericIntUpDown#PART_PageInput">
<Setter Property="IsVisible" Value="False"></Setter>
</Style>
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="{x:Type u:PaginationButton}" <ControlTheme x:Key="{x:Type u:PaginationButton}"