PagerControl
struct · ferroui-controls · v0.5.0
struct PagerControl
A control to move through the pages of a paged content (WinUI's PagerControl): buttons to
the first, previous, next and last page around a combo box of the page numbers, a number box
to type one, or a button for each page (DisplayMode). NumberOfPages is -1 while the number
of pages is not known; SelectedPageIndex is the index of the page, from 0, kept in the range
of the pages, and its changes raise SelectedIndexChanged.
The template is the control theme of the WinUI theme (Controls/PagerControl.xaml, from
WinUI's PagerControl.xaml), with WinUI's parts FirstPageButton, PreviousPageButton,
NextPageButton, LastPageButton, ComboBoxDisplay, NumberBoxDisplay,
NumberPanelItemsRepeater and NumberPanelCurrentPageIndicator. The control sets WinUI's
visual states as pseudo-classes: :numberbox, :combobox and :numberpanel (the display
mode), :infinite (InfiniteItems), and for each button :<button>collapsed,
:<button>hidden and :<button>disabled (:firstcollapsed, :nexthidden, ...). The
Fluent and Simple themes have no template for it (docs/porting/winui-controls.md, section 5.1).
Differences (docs/porting/winui-controls.md, G2): the number panel is an items control whose
panel is a horizontal stack panel, where WinUI has an ItemsRepeater with a StackLayout
(ferroui-controls cannot depend on the repeater crate); the indicator of the current page
moves without WinUI's RepositionThemeTransition.
Members
TYPEto_refdisplay_mode_propertynumber_of_pages_propertyselected_page_index_propertyfirst_button_visibility_propertyprevious_button_visibility_propertynext_button_visibility_propertylast_button_visibility_propertyfirst_button_command_propertyprevious_button_command_propertynext_button_command_propertylast_button_command_propertypager_input_command_propertyfirst_button_style_propertyprevious_button_style_propertynext_button_style_propertylast_button_style_propertybutton_panel_always_show_first_last_page_index_propertyprefix_text_propertysuffix_text_propertytemplate_settings_propertyconstructnewdisplay_modeset_display_modenumber_of_pagesset_number_of_pagesselected_page_indexset_selected_page_indexfirst_button_visibilityset_first_button_visibilityprevious_button_visibilityset_previous_button_visibilitynext_button_visibilityset_next_button_visibilitylast_button_visibilityset_last_button_visibilityfirst_button_commandset_first_button_commandprevious_button_commandset_previous_button_commandnext_button_commandset_next_button_commandlast_button_commandset_last_button_commandpager_input_commandset_pager_input_commandfirst_button_styleset_first_button_styleprevious_button_styleset_previous_button_stylenext_button_styleset_next_button_stylelast_button_styleset_last_button_stylebutton_panel_always_show_first_last_page_indexset_button_panel_always_show_first_last_page_indexprefix_textset_prefix_textsuffix_textset_suffix_texttemplate_settingsselected_index_changed
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<PagerControl>
Returns a strong reference to this object.
display_mode_property
fn display_mode_property() -> &'static StyledProperty<PagerControlDisplayMode>
Defines the DisplayMode property: how the pages are shown. Auto by default.
number_of_pages_property
fn number_of_pages_property() -> &'static StyledProperty<i32>
Defines the NumberOfPages property: the number of pages, -1 while it is not known. 0 by
default.
selected_page_index_property
fn selected_page_index_property() -> &'static StyledProperty<i32>
Defines the SelectedPageIndex property: the index of the selected page, from 0.
first_button_visibility_property
fn first_button_visibility_property() -> &'static StyledProperty<PagerControlButtonVisibility>
Defines the FirstButtonVisibility property: when the button to the first page is
shown.
previous_button_visibility_property
fn previous_button_visibility_property() -> &'static StyledProperty<PagerControlButtonVisibility>
Defines the PreviousButtonVisibility property: when the button to the previous page is
shown.
next_button_visibility_property
fn next_button_visibility_property() -> &'static StyledProperty<PagerControlButtonVisibility>
Defines the NextButtonVisibility property: when the button to the next page is shown.
last_button_visibility_property
fn last_button_visibility_property() -> &'static StyledProperty<PagerControlButtonVisibility>
Defines the LastButtonVisibility property: when the button to the last page is shown.
first_button_command_property
fn first_button_command_property() -> &'static StyledProperty<Option<Rc<dyn ICommand>>>
Defines the FirstButtonCommand property: the command the button to the first page
executes after it moves to the page.
previous_button_command_property
fn previous_button_command_property() -> &'static StyledProperty<Option<Rc<dyn ICommand>>>
Defines the PreviousButtonCommand property: the command the button to the previous
page executes after it moves to the page.
next_button_command_property
fn next_button_command_property() -> &'static StyledProperty<Option<Rc<dyn ICommand>>>
Defines the NextButtonCommand property: the command the button to the next page
executes after it moves to the page.
last_button_command_property
fn last_button_command_property() -> &'static StyledProperty<Option<Rc<dyn ICommand>>>
Defines the LastButtonCommand property: the command the button to the last page
executes after it moves to the page.
pager_input_command_property
fn pager_input_command_property() -> &'static StyledProperty<Option<Rc<dyn ICommand>>>
Defines the PagerInputCommand property, which WinUI declares and never executes.
first_button_style_property
fn first_button_style_property() -> &'static StyledProperty<Option<Ref<ControlTheme>>>
Defines the FirstButtonStyle property: the control theme of the button to the first
page.
previous_button_style_property
fn previous_button_style_property() -> &'static StyledProperty<Option<Ref<ControlTheme>>>
Defines the PreviousButtonStyle property: the control theme of the button to the
previous page.
next_button_style_property
fn next_button_style_property() -> &'static StyledProperty<Option<Ref<ControlTheme>>>
Defines the NextButtonStyle property: the control theme of the button to the next
page.
last_button_style_property
fn last_button_style_property() -> &'static StyledProperty<Option<Ref<ControlTheme>>>
Defines the LastButtonStyle property: the control theme of the button to the last
page.
button_panel_always_show_first_last_page_index_property
fn button_panel_always_show_first_last_page_index_property() -> &'static StyledProperty<bool>
Defines the ButtonPanelAlwaysShowFirstLastPageIndex property: whether the button panel
always shows the buttons of the first and the last page. true by default.
prefix_text_property
fn prefix_text_property() -> &'static StyledProperty<String>
Defines the PrefixText property: the text before the combo box or the number box
("Page" when the template is applied without one).
suffix_text_property
fn suffix_text_property() -> &'static StyledProperty<String>
Defines the SuffixText property: the text after the combo box or the number box, before
the number of pages ("of" when the template is applied without one).
template_settings_property
fn template_settings_property() -> &'static StyledProperty<Option<Ref<PagerControlTemplateSettings>>>
Defines the TemplateSettings property: the page numbers and the number panel items the
template binds to.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
Creates a pager without pages.
display_mode
fn display_mode(self: &Self) -> PagerControlDisplayMode
Gets how the pages are shown.
set_display_mode
fn set_display_mode(self: &Self, value: PagerControlDisplayMode)
Sets how the pages are shown.
number_of_pages
fn number_of_pages(self: &Self) -> i32
Gets the number of pages, -1 while it is not known.
set_number_of_pages
fn set_number_of_pages(self: &Self, value: i32)
Sets the number of pages, -1 while it is not known.
selected_page_index
fn selected_page_index(self: &Self) -> i32
Gets the index of the selected page.
set_selected_page_index
fn set_selected_page_index(self: &Self, value: i32)
Sets the index of the selected page; raises SelectedIndexChanged.
first_button_visibility
fn first_button_visibility(self: &Self) -> PagerControlButtonVisibility
Gets when the button to the first page is shown.
set_first_button_visibility
fn set_first_button_visibility(self: &Self, value: PagerControlButtonVisibility)
Sets when the button to the first page is shown.
previous_button_visibility
fn previous_button_visibility(self: &Self) -> PagerControlButtonVisibility
Gets when the button to the previous page is shown.
set_previous_button_visibility
fn set_previous_button_visibility(self: &Self, value: PagerControlButtonVisibility)
Sets when the button to the previous page is shown.
next_button_visibility
fn next_button_visibility(self: &Self) -> PagerControlButtonVisibility
Gets when the button to the next page is shown.
set_next_button_visibility
fn set_next_button_visibility(self: &Self, value: PagerControlButtonVisibility)
Sets when the button to the next page is shown.
last_button_visibility
fn last_button_visibility(self: &Self) -> PagerControlButtonVisibility
Gets when the button to the last page is shown.
set_last_button_visibility
fn set_last_button_visibility(self: &Self, value: PagerControlButtonVisibility)
Sets when the button to the last page is shown.
first_button_command
fn first_button_command(self: &Self) -> Option<Rc<dyn ICommand>>
Gets the command of the button to the first page.
set_first_button_command
fn set_first_button_command(self: &Self, value: Option<Rc<dyn ICommand>>)
Sets the command of the button to the first page.
previous_button_command
fn previous_button_command(self: &Self) -> Option<Rc<dyn ICommand>>
Gets the command of the button to the previous page.
set_previous_button_command
fn set_previous_button_command(self: &Self, value: Option<Rc<dyn ICommand>>)
Sets the command of the button to the previous page.
next_button_command
fn next_button_command(self: &Self) -> Option<Rc<dyn ICommand>>
Gets the command of the button to the next page.
set_next_button_command
fn set_next_button_command(self: &Self, value: Option<Rc<dyn ICommand>>)
Sets the command of the button to the next page.
last_button_command
fn last_button_command(self: &Self) -> Option<Rc<dyn ICommand>>
Gets the command of the button to the last page.
set_last_button_command
fn set_last_button_command(self: &Self, value: Option<Rc<dyn ICommand>>)
Sets the command of the button to the last page.
pager_input_command
fn pager_input_command(self: &Self) -> Option<Rc<dyn ICommand>>
Gets the command WinUI declares as PagerInputCommand (never executed).
set_pager_input_command
fn set_pager_input_command(self: &Self, value: Option<Rc<dyn ICommand>>)
Sets the command WinUI declares as PagerInputCommand (never executed).
first_button_style
fn first_button_style(self: &Self) -> Option<Ref<ControlTheme>>
Gets the control theme of the button to the first page.
set_first_button_style
fn set_first_button_style(self: &Self, value: Option<Ref<ControlTheme>>)
Sets the control theme of the button to the first page.
previous_button_style
fn previous_button_style(self: &Self) -> Option<Ref<ControlTheme>>
Gets the control theme of the button to the previous page.
set_previous_button_style
fn set_previous_button_style(self: &Self, value: Option<Ref<ControlTheme>>)
Sets the control theme of the button to the previous page.
next_button_style
fn next_button_style(self: &Self) -> Option<Ref<ControlTheme>>
Gets the control theme of the button to the next page.
set_next_button_style
fn set_next_button_style(self: &Self, value: Option<Ref<ControlTheme>>)
Sets the control theme of the button to the next page.
last_button_style
fn last_button_style(self: &Self) -> Option<Ref<ControlTheme>>
Gets the control theme of the button to the last page.
set_last_button_style
fn set_last_button_style(self: &Self, value: Option<Ref<ControlTheme>>)
Sets the control theme of the button to the last page.
button_panel_always_show_first_last_page_index
fn button_panel_always_show_first_last_page_index(self: &Self) -> bool
Gets whether the button panel always shows the buttons of the first and the last page.
set_button_panel_always_show_first_last_page_index
fn set_button_panel_always_show_first_last_page_index(self: &Self, value: bool)
Sets whether the button panel always shows the buttons of the first and the last page.
prefix_text
fn prefix_text(self: &Self) -> String
Gets the text before the combo box or the number box.
set_prefix_text
fn set_prefix_text(self: &Self, value: impl Into<String>)
Sets the text before the combo box or the number box.
suffix_text
fn suffix_text(self: &Self) -> String
Gets the text after the combo box or the number box.
set_suffix_text
fn set_suffix_text(self: &Self, value: impl Into<String>)
Sets the text after the combo box or the number box.
template_settings
fn template_settings(self: &Self) -> Ref<PagerControlTemplateSettings>
Gets the page numbers and the number panel items the template binds to.
selected_index_changed
fn selected_index_changed(self: &Self, handler: impl Fn(&PagerControl, &PagerControlSelectedIndexChangedEventArgs) -> () + 'static) -> Subscription
Adds a handler of the SelectedIndexChanged event, raised for every change of
SelectedPageIndex and when the template is applied.
Dropping the returned guard removes the handler; Subscription::detach keeps it
for the life of the control.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeTemplatedControlImplExtControlImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<PagerControl>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleStyledElementImplVisualImplLayoutableImplInteractiveImplFerroObjectImplControlImplTemplatedControlImplInputElementImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.