FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    NavigationView

    struct · ferroui-controls · v0.5.0

    struct NavigationView
    

    A navigation pane with menu items and a content area (WinUI's NavigationView).

    The pane is at the left (Left, LeftCompact, LeftMinimal, or chosen by the width in Auto: the display modes Expanded, Compact and Minimal) or at the top (Top). The template of the WinUI theme is WinUI's (NavigationView.xaml): the control finds WinUI's parts (RootSplitView, TogglePaneButton, NavigationViewBackButton, NavigationViewCloseButton, PaneAutoSuggestButton, PaneTitleTextBlock, PaneTitleHolder, PaneTitlePresenter, PaneTitleOnTopPane, MenuItemsHost, FooterMenuItemsHost, TopNavMenuItemsHost, TopFooterMenuItemsHost, the content controls of the pane header, custom content, footer and auto suggest box of the left and the top pane, ContentLeftPadding), sets their contents and the values of template_settings as WinUI's code does, and sets WinUI's visual states as pseudo-classes (:compact, :expanded, :minimal, :top-navigation-minimal, :minimal-with-back-button, :toggle-pane-button-visible, :header-collapsed, :auto-suggest-box-collapsed, :closed-compact, :list-size-compact, :pane-not-overlaying, :back-button-collapsed, :pane-collapsed, and :back-button-row-visible for the row WinUI sizes in code). The Fluent and Simple themes have no template.

    The menu items are realized in stack panels, not in ItemsRepeaters with a hierarchical SelectionModel (follow-up F1). Missing (docs/porting/winui-controls.md, section 10.4): the overflow of the top pane, the animations of the pane, the shadow of the pane, the padding of the title bar, the shoulder navigation and the selectors of templates and styles.

    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<NavigationView>
    

    Returns a strong reference to this object.

    Source

    is_pane_open_property

    fn is_pane_open_property() -> &'static StyledProperty<bool>
    

    Defines the IsPaneOpen property: whether the pane is open. true by default.

    Source

    compact_mode_threshold_width_property

    fn compact_mode_threshold_width_property() -> &'static StyledProperty<f64>
    

    Defines the CompactModeThresholdWidth property: the width from which the display mode of Auto is Compact. 641 by default.

    Source

    expanded_mode_threshold_width_property

    fn expanded_mode_threshold_width_property() -> &'static StyledProperty<f64>
    

    Defines the ExpandedModeThresholdWidth property: the width from which the display mode of Auto is Expanded. 1008 by default.

    Source

    is_settings_visible_property

    fn is_settings_visible_property() -> &'static StyledProperty<bool>
    

    Defines the IsSettingsVisible property: whether the settings item is shown. true by default.

    Source

    is_pane_toggle_button_visible_property

    fn is_pane_toggle_button_visible_property() -> &'static StyledProperty<bool>
    

    Defines the IsPaneToggleButtonVisible property. true by default.

    Source

    always_show_header_property

    fn always_show_header_property() -> &'static StyledProperty<bool>
    

    Defines the AlwaysShowHeader property. true by default.

    Source

    compact_pane_length_property

    fn compact_pane_length_property() -> &'static StyledProperty<f64>
    

    Defines the CompactPaneLength property: the width of the closed compact pane. 48 by default; the WinUI theme sets NavigationViewCompactPaneLength.

    Source

    open_pane_length_property

    fn open_pane_length_property() -> &'static StyledProperty<f64>
    

    Defines the OpenPaneLength property: the width of the open pane. 320 by default.

    Source

    is_pane_visible_property

    fn is_pane_visible_property() -> &'static StyledProperty<bool>
    

    Defines the IsPaneVisible property: whether the pane is shown at all. true by default.

    Source

    is_back_enabled_property

    fn is_back_enabled_property() -> &'static StyledProperty<bool>
    

    Defines the IsBackEnabled property: whether the back button is enabled.

    Source

    is_back_button_visible_property

    fn is_back_button_visible_property() -> &'static StyledProperty<NavigationViewBackButtonVisible>
    

    Defines the IsBackButtonVisible property. Auto by default.

    Source

    pane_display_mode_property

    fn pane_display_mode_property() -> &'static StyledProperty<NavigationViewPaneDisplayMode>
    

    Defines the PaneDisplayMode property. Auto by default.

    Source

    selection_follows_focus_property

    fn selection_follows_focus_property() -> &'static StyledProperty<NavigationViewSelectionFollowsFocus>
    

    Defines the SelectionFollowsFocus property. Disabled by default.

    Source

    pane_title_property

    fn pane_title_property() -> &'static StyledProperty<String>
    

    Defines the PaneTitle property: the title of the pane.

    Source

    header_property

    fn header_property() -> &'static StyledProperty<Option<BoxedValue>>
    

    Defines the Header property: the header above the content.

    Source

    header_template_property

    fn header_template_property() -> &'static StyledProperty<Option<Rc<dyn IDataTemplate>>>
    

    Defines the HeaderTemplate property.

    Source

    selected_item_property

    fn selected_item_property() -> &'static StyledProperty<Option<BoxedValue>>
    

    Defines the SelectedItem property: the selected menu item (the data item or the container).

    Source

    pane_header_property

    fn pane_header_property() -> &'static StyledProperty<Option<Ref<Control>>>
    

    Defines the PaneHeader property.

    Source

    fn pane_footer_property() -> &'static StyledProperty<Option<Ref<Control>>>
    

    Defines the PaneFooter property.

    Source

    pane_custom_content_property

    fn pane_custom_content_property() -> &'static StyledProperty<Option<Ref<Control>>>
    

    Defines the PaneCustomContent property.

    Source

    content_overlay_property

    fn content_overlay_property() -> &'static StyledProperty<Option<Ref<Control>>>
    

    Defines the ContentOverlay property: content shown under the top pane.

    Source

    auto_suggest_box_property

    fn auto_suggest_box_property() -> &'static StyledProperty<Option<Ref<AutoSuggestBox>>>
    

    Defines the AutoSuggestBox property: the search box of the pane.

    Source

    menu_items_source_property

    fn menu_items_source_property() -> &'static StyledProperty<Option<ItemsSource>>
    

    Defines the MenuItemsSource property.

    Source

    fn footer_menu_items_source_property() -> &'static StyledProperty<Option<ItemsSource>>
    

    Defines the FooterMenuItemsSource property.

    Source

    menu_item_template_property

    fn menu_item_template_property() -> &'static StyledProperty<Option<Rc<dyn IDataTemplate>>>
    

    Defines the MenuItemTemplate property: the template of the data items.

    Source

    pane_toggle_button_style_property

    fn pane_toggle_button_style_property() -> &'static StyledProperty<Option<Ref<ControlTheme>>>
    

    Defines the PaneToggleButtonStyle property: the control theme of the pane toggle button (WinUI's style; the WinUI theme sets PaneToggleButtonStyle).

    Source

    menu_item_container_style_property

    fn menu_item_container_style_property() -> &'static StyledProperty<Option<Ref<ControlTheme>>>
    

    Defines the MenuItemContainerStyle property: the control theme of the containers.

    Source

    menu_items_property

    fn menu_items_property() -> &'static DirectProperty<NavigationView, ItemCollection>
    

    Defines the MenuItems property (read-only; the collection is writable).

    Source

    fn footer_menu_items_property() -> &'static DirectProperty<NavigationView, ItemCollection>
    

    Defines the FooterMenuItems property (read-only; the collection is writable).

    Source

    settings_item_property

    fn settings_item_property() -> &'static DirectProperty<NavigationView, Option<BoxedValue>>
    

    Defines the SettingsItem property: the settings item (read-only).

    Source

    display_mode_property

    fn display_mode_property() -> &'static DirectProperty<NavigationView, NavigationViewDisplayMode>
    

    Defines the DisplayMode property: the display mode (read-only).

    Source

    template_settings_property

    fn template_settings_property() -> &'static DirectProperty<NavigationView, Ref<NavigationViewTemplateSettings>>
    

    Defines the TemplateSettings property: the values the template binds to (read-only).

    Source

    construct

    fn construct() -> Self
    

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

    Source

    new

    fn new() -> Ref<Self>
    

    Creates a navigation view.

    Source

    menu_items

    fn menu_items(self: &Self) -> ItemCollection
    

    Gets the menu items (writable, also while MenuItemsSource is set).

    Source

    fn footer_menu_items(self: &Self) -> ItemCollection
    

    Gets the footer menu items (writable, also while FooterMenuItemsSource is set).

    Source

    settings_item

    fn settings_item(self: &Self) -> Ref<NavigationViewItem>
    

    Gets the settings item.

    Source

    template_settings

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

    Gets the values the template binds to.

    Source

    display_mode

    fn display_mode(self: &Self) -> NavigationViewDisplayMode
    

    Gets the display mode.

    Source

    is_pane_open

    fn is_pane_open(self: &Self) -> bool
    

    Source

    set_is_pane_open

    fn set_is_pane_open(self: &Self, value: bool)
    

    Source

    compact_mode_threshold_width

    fn compact_mode_threshold_width(self: &Self) -> f64
    

    Source

    set_compact_mode_threshold_width

    fn set_compact_mode_threshold_width(self: &Self, value: f64)
    

    Source

    expanded_mode_threshold_width

    fn expanded_mode_threshold_width(self: &Self) -> f64
    

    Source

    set_expanded_mode_threshold_width

    fn set_expanded_mode_threshold_width(self: &Self, value: f64)
    

    Source

    is_settings_visible

    fn is_settings_visible(self: &Self) -> bool
    

    Source

    set_is_settings_visible

    fn set_is_settings_visible(self: &Self, value: bool)
    

    Source

    is_pane_toggle_button_visible

    fn is_pane_toggle_button_visible(self: &Self) -> bool
    

    Source

    set_is_pane_toggle_button_visible

    fn set_is_pane_toggle_button_visible(self: &Self, value: bool)
    

    Source

    always_show_header

    fn always_show_header(self: &Self) -> bool
    

    Source

    set_always_show_header

    fn set_always_show_header(self: &Self, value: bool)
    

    Source

    compact_pane_length

    fn compact_pane_length(self: &Self) -> f64
    

    Source

    set_compact_pane_length

    fn set_compact_pane_length(self: &Self, value: f64)
    

    Source

    open_pane_length

    fn open_pane_length(self: &Self) -> f64
    

    Source

    set_open_pane_length

    fn set_open_pane_length(self: &Self, value: f64)
    

    Source

    is_pane_visible

    fn is_pane_visible(self: &Self) -> bool
    

    Source

    set_is_pane_visible

    fn set_is_pane_visible(self: &Self, value: bool)
    

    Source

    is_back_enabled

    fn is_back_enabled(self: &Self) -> bool
    

    Source

    set_is_back_enabled

    fn set_is_back_enabled(self: &Self, value: bool)
    

    Source

    is_back_button_visible

    fn is_back_button_visible(self: &Self) -> NavigationViewBackButtonVisible
    

    Source

    set_is_back_button_visible

    fn set_is_back_button_visible(self: &Self, value: NavigationViewBackButtonVisible)
    

    Source

    pane_display_mode

    fn pane_display_mode(self: &Self) -> NavigationViewPaneDisplayMode
    

    Source

    set_pane_display_mode

    fn set_pane_display_mode(self: &Self, value: NavigationViewPaneDisplayMode)
    

    Source

    selection_follows_focus

    fn selection_follows_focus(self: &Self) -> NavigationViewSelectionFollowsFocus
    

    Source

    set_selection_follows_focus

    fn set_selection_follows_focus(self: &Self, value: NavigationViewSelectionFollowsFocus)
    

    Source

    pane_title

    fn pane_title(self: &Self) -> String
    

    Source

    set_pane_title

    fn set_pane_title(self: &Self, value: String)
    

    Source

    header

    fn header(self: &Self) -> Option<BoxedValue>
    

    Source

    set_header

    fn set_header(self: &Self, value: Option<BoxedValue>)
    

    Source

    header_template

    fn header_template(self: &Self) -> Option<Rc<dyn IDataTemplate>>
    

    Source

    set_header_template

    fn set_header_template(self: &Self, value: Option<Rc<dyn IDataTemplate>>)
    

    Source

    selected_item

    fn selected_item(self: &Self) -> Option<BoxedValue>
    

    Source

    set_selected_item

    fn set_selected_item(self: &Self, value: Option<BoxedValue>)
    

    Source

    pane_header

    fn pane_header(self: &Self) -> Option<Ref<Control>>
    

    Source

    set_pane_header

    fn set_pane_header(self: &Self, value: Option<Ref<Control>>)
    

    Source

    fn pane_footer(self: &Self) -> Option<Ref<Control>>
    

    Source

    fn set_pane_footer(self: &Self, value: Option<Ref<Control>>)
    

    Source

    pane_custom_content

    fn pane_custom_content(self: &Self) -> Option<Ref<Control>>
    

    Source

    set_pane_custom_content

    fn set_pane_custom_content(self: &Self, value: Option<Ref<Control>>)
    

    Source

    content_overlay

    fn content_overlay(self: &Self) -> Option<Ref<Control>>
    

    Source

    set_content_overlay

    fn set_content_overlay(self: &Self, value: Option<Ref<Control>>)
    

    Source

    auto_suggest_box

    fn auto_suggest_box(self: &Self) -> Option<Ref<AutoSuggestBox>>
    

    Source

    set_auto_suggest_box

    fn set_auto_suggest_box(self: &Self, value: Option<Ref<AutoSuggestBox>>)
    

    Source

    menu_items_source

    fn menu_items_source(self: &Self) -> Option<ItemsSource>
    

    Source

    set_menu_items_source

    fn set_menu_items_source(self: &Self, value: Option<ItemsSource>)
    

    Source

    fn footer_menu_items_source(self: &Self) -> Option<ItemsSource>
    

    Source

    fn set_footer_menu_items_source(self: &Self, value: Option<ItemsSource>)
    

    Source

    menu_item_template

    fn menu_item_template(self: &Self) -> Option<Rc<dyn IDataTemplate>>
    

    Source

    set_menu_item_template

    fn set_menu_item_template(self: &Self, value: Option<Rc<dyn IDataTemplate>>)
    

    Source

    pane_toggle_button_style

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

    Source

    set_pane_toggle_button_style

    fn set_pane_toggle_button_style(self: &Self, value: Option<Ref<ControlTheme>>)
    

    Source

    menu_item_container_style

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

    Source

    set_menu_item_container_style

    fn set_menu_item_container_style(self: &Self, value: Option<Ref<ControlTheme>>)
    

    Source

    selection_changed

    fn selection_changed(self: &Self, handler: impl Fn(&NavigationViewSelectionChangedEventArgs) -> () + 'static) -> Subscription
    

    Adds a handler of SelectionChanged. Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the view.

    Source

    item_invoked

    fn item_invoked(self: &Self, handler: impl Fn(&NavigationViewItemInvokedEventArgs) -> () + 'static) -> Subscription
    

    Adds a handler of ItemInvoked. Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the view.

    Source

    display_mode_changed

    fn display_mode_changed(self: &Self, handler: impl Fn(&NavigationViewDisplayModeChangedEventArgs) -> () + 'static) -> Subscription
    

    Adds a handler of DisplayModeChanged. Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the view.

    Source

    back_requested

    fn back_requested(self: &Self, handler: impl Fn(&NavigationViewBackRequestedEventArgs) -> () + 'static) -> Subscription
    

    Adds a handler of BackRequested. Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the view.

    Source

    pane_closing

    fn pane_closing(self: &Self, handler: impl Fn(&NavigationViewPaneClosingEventArgs) -> () + 'static) -> Subscription
    

    Adds a handler of PaneClosing. Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the view.

    Source

    expanding

    fn expanding(self: &Self, handler: impl Fn(&NavigationViewItemExpandingEventArgs) -> () + 'static) -> Subscription
    

    Adds a handler of Expanding. Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the view.

    Source

    collapsed

    fn collapsed(self: &Self, handler: impl Fn(&NavigationViewItemCollapsedEventArgs) -> () + 'static) -> Subscription
    

    Adds a handler of Collapsed. Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the view.

    Source

    pane_opening

    fn pane_opening(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
    

    Adds a handler of PaneOpening. Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the view.

    Source

    pane_opened

    fn pane_opened(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
    

    Adds a handler of PaneOpened. Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the view.

    Source

    pane_closed

    fn pane_closed(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
    

    Adds a handler of PaneClosed. Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the view.

    Source

    container_from_menu_item

    fn container_from_menu_item(self: &Self, item: &Option<BoxedValue>) -> Option<Ref<NavigationViewItemBase>>
    

    Gets the realized container of a menu item, a footer item or a nested item (ContainerFromMenuItem).

    Source

    menu_item_from_container

    fn menu_item_from_container(self: &Self, container: &FerroObject) -> Option<BoxedValue>
    

    Gets the menu item of a container (MenuItemFromContainer).

    Source

    expand

    fn expand(self: &Self, item: &NavigationViewItem)
    

    Expands an item that has children (Expand).

    Source

    collapse

    fn collapse(self: &Self, item: &NavigationViewItem)
    

    Collapses an item that has children (Collapse).

    Source

    Trait implementations

    Availability

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