Files
Ursa.Avalonia/demo/Ursa.Demo/Pages/PaginationDemo.axaml
Soar360 74ad5f4111 为 Pagination 控件增加 CurrentPageChanged 事件
为 Pagination 控件增加 Command 属性
为 Pagination 控件增加 Command 属性的使用 Demo
2024-03-23 14:46:32 +08:00

32 lines
1.3 KiB
XML

<UserControl
x:Class="Ursa.Demo.Pages.PaginationDemo"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:u="https://irihi.tech/ursa"
xmlns:viewModels="clr-namespace:Ursa.Demo.ViewModels"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<Design.DataContext>
<viewModels:PaginationDemoViewModel />
</Design.DataContext>
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Current Page: "></TextBlock>
<TextBlock Text="{Binding #page.CurrentPage}" />
</StackPanel>
<ToggleSwitch Name="pageSizeSelector" Content="Show Page Size Selector" />
<ToggleSwitch Name="quickJumperSelector" Content="Show Quick Jumper"></ToggleSwitch>
<u:Pagination
Name="page"
PageSizeOptions="10, 20, 50, 100"
ShowQuickJump="{Binding #quickJumperSelector.IsChecked}"
ShowPageSizeSelector="{Binding #pageSizeSelector.IsChecked}"
Command="{Binding LoadPageCommand}"
CommandParameter="{Binding $self.CurrentPage}"
TotalCount="600" />
</StackPanel>
</UserControl>