FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<PagerControl>
    

    Returns a strong reference to this object.

    Source

    display_mode_property

    fn display_mode_property() -> &'static StyledProperty<PagerControlDisplayMode>
    

    Defines the DisplayMode property: how the pages are shown. Auto by default.

    Source

    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.

    Source

    selected_page_index_property

    fn selected_page_index_property() -> &'static StyledProperty<i32>
    

    Defines the SelectedPageIndex property: the index of the selected page, from 0.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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).

    Source

    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).

    Source

    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.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see ferroui_base::FerroObject::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Creates a pager without pages.

    Source

    display_mode

    fn display_mode(self: &Self) -> PagerControlDisplayMode
    

    Gets how the pages are shown.

    Source

    set_display_mode

    fn set_display_mode(self: &Self, value: PagerControlDisplayMode)
    

    Sets how the pages are shown.

    Source

    number_of_pages

    fn number_of_pages(self: &Self) -> i32
    

    Gets the number of pages, -1 while it is not known.

    Source

    set_number_of_pages

    fn set_number_of_pages(self: &Self, value: i32)
    

    Sets the number of pages, -1 while it is not known.

    Source

    selected_page_index

    fn selected_page_index(self: &Self) -> i32
    

    Gets the index of the selected page.

    Source

    set_selected_page_index

    fn set_selected_page_index(self: &Self, value: i32)
    

    Sets the index of the selected page; raises SelectedIndexChanged.

    Source

    first_button_visibility

    fn first_button_visibility(self: &Self) -> PagerControlButtonVisibility
    

    Gets when the button to the first page is shown.

    Source

    set_first_button_visibility

    fn set_first_button_visibility(self: &Self, value: PagerControlButtonVisibility)
    

    Sets when the button to the first page is shown.

    Source

    previous_button_visibility

    fn previous_button_visibility(self: &Self) -> PagerControlButtonVisibility
    

    Gets when the button to the previous page is shown.

    Source

    set_previous_button_visibility

    fn set_previous_button_visibility(self: &Self, value: PagerControlButtonVisibility)
    

    Sets when the button to the previous page is shown.

    Source

    next_button_visibility

    fn next_button_visibility(self: &Self) -> PagerControlButtonVisibility
    

    Gets when the button to the next page is shown.

    Source

    set_next_button_visibility

    fn set_next_button_visibility(self: &Self, value: PagerControlButtonVisibility)
    

    Sets when the button to the next page is shown.

    Source

    last_button_visibility

    fn last_button_visibility(self: &Self) -> PagerControlButtonVisibility
    

    Gets when the button to the last page is shown.

    Source

    set_last_button_visibility

    fn set_last_button_visibility(self: &Self, value: PagerControlButtonVisibility)
    

    Sets when the button to the last page is shown.

    Source

    first_button_command

    fn first_button_command(self: &Self) -> Option<Rc<dyn ICommand>>
    

    Gets the command of the button to the first page.

    Source

    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.

    Source

    previous_button_command

    fn previous_button_command(self: &Self) -> Option<Rc<dyn ICommand>>
    

    Gets the command of the button to the previous page.

    Source

    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.

    Source

    next_button_command

    fn next_button_command(self: &Self) -> Option<Rc<dyn ICommand>>
    

    Gets the command of the button to the next page.

    Source

    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.

    Source

    last_button_command

    fn last_button_command(self: &Self) -> Option<Rc<dyn ICommand>>
    

    Gets the command of the button to the last page.

    Source

    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.

    Source

    pager_input_command

    fn pager_input_command(self: &Self) -> Option<Rc<dyn ICommand>>
    

    Gets the command WinUI declares as PagerInputCommand (never executed).

    Source

    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).

    Source

    first_button_style

    fn first_button_style(self: &Self) -> Option<Ref<ControlTheme>>
    

    Gets the control theme of the button to the first page.

    Source

    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.

    Source

    previous_button_style

    fn previous_button_style(self: &Self) -> Option<Ref<ControlTheme>>
    

    Gets the control theme of the button to the previous page.

    Source

    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.

    Source

    next_button_style

    fn next_button_style(self: &Self) -> Option<Ref<ControlTheme>>
    

    Gets the control theme of the button to the next page.

    Source

    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.

    Source

    last_button_style

    fn last_button_style(self: &Self) -> Option<Ref<ControlTheme>>
    

    Gets the control theme of the button to the last page.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    prefix_text

    fn prefix_text(self: &Self) -> String
    

    Gets the text before the combo box or the number box.

    Source

    set_prefix_text

    fn set_prefix_text(self: &Self, value: impl Into<String>)
    

    Sets the text before the combo box or the number box.

    Source

    suffix_text

    fn suffix_text(self: &Self) -> String
    

    Gets the text after the combo box or the number box.

    Source

    set_suffix_text

    fn set_suffix_text(self: &Self, value: impl Into<String>)
    

    Sets the text after the combo box or the number box.

    Source

    template_settings

    fn template_settings(self: &Self) -> Ref<PagerControlTemplateSettings>
    

    Gets the page numbers and the number panel items the template binds to.

    Source

    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.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.