FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    NavigationViewItem

    struct · ferroui-controls · v0.5.0

    struct NavigationViewItem
    

    A selectable item of a NavigationView, with an icon, an info badge and child items (WinUI's NavigationViewItem).

    The template of the WinUI theme draws the item as WinUI's item presenter does (NavigationViewItemPresenter and its styles for the left and the top pane, folded into the template of the item). The item sets the states of WinUI as pseudo-classes: :selected, :pressed, :on-top-navigation-primary, :icon-collapsed, :icon-only, :content-only, :info-badge-collapsed, :chevron-visible-open, :chevron-visible-closed and :closed-compact-and-top-level-item. The child items are hosted in the template part NavigationViewItemMenuItemsHost, below the item, or in the popup ChildrenFlyout when the item is in the top pane or at the top level of a closed compact pane, as WinUI moves its repeater into its flyout. The Fluent and Simple themes have no template.

    The children are realized in a stack panel, not an ItemsRepeater (follow-up F1); the containers of data items are reused across edits of the collections.

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

    Returns a strong reference to this object.

    Source

    icon_property

    fn icon_property() -> &'static StyledProperty<Option<Ref<IconElement>>>
    

    Defines the Icon property: the icon of the item.

    Source

    info_badge_property

    fn info_badge_property() -> &'static StyledProperty<Option<Ref<InfoBadge>>>
    

    Defines the InfoBadge property: the badge shown beside the content of the item.

    Source

    compact_pane_length_property

    fn compact_pane_length_property() -> &'static DirectProperty<NavigationViewItem, f64>
    

    Defines the CompactPaneLength property: the compact pane length of the navigation view (read-only).

    Source

    selects_on_invoked_property

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

    Defines the SelectsOnInvoked property: whether invoking the item selects it. true by default.

    Source

    is_expanded_property

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

    Defines the IsExpanded property: whether the child items are shown.

    Source

    has_unrealized_children_property

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

    Defines the HasUnrealizedChildren property: whether the item has children that the application adds when it expands.

    Source

    is_child_selected_property

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

    Defines the IsChildSelected property: whether a descendant item is selected.

    Source

    menu_items_property

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

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

    Source

    menu_items_source_property

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

    Defines the MenuItemsSource property: the source of the child items, which takes precedence over MenuItems while it is set.

    Source

    construct

    fn construct() -> Self
    

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

    Source

    new

    fn new() -> Ref<Self>
    

    Creates an item.

    Source

    icon

    fn icon(self: &Self) -> Option<Ref<IconElement>>
    

    Gets the icon.

    Source

    set_icon

    fn set_icon(self: &Self, value: Option<Ref<IconElement>>)
    

    Sets the icon.

    Source

    info_badge

    fn info_badge(self: &Self) -> Option<Ref<InfoBadge>>
    

    Gets the info badge.

    Source

    set_info_badge

    fn set_info_badge(self: &Self, value: Option<Ref<InfoBadge>>)
    

    Sets the info badge.

    Source

    compact_pane_length

    fn compact_pane_length(self: &Self) -> f64
    

    Gets the compact pane length of the navigation view of the item.

    Source

    selects_on_invoked

    fn selects_on_invoked(self: &Self) -> bool
    

    Gets whether invoking the item selects it.

    Source

    set_selects_on_invoked

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

    Sets whether invoking the item selects it.

    Source

    is_expanded

    fn is_expanded(self: &Self) -> bool
    

    Gets whether the child items are shown.

    Source

    set_is_expanded

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

    Sets whether the child items are shown.

    Source

    has_unrealized_children

    fn has_unrealized_children(self: &Self) -> bool
    

    Gets whether the item has children the application adds when it expands.

    Source

    set_has_unrealized_children

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

    Sets whether the item has children the application adds when it expands.

    Source

    is_child_selected

    fn is_child_selected(self: &Self) -> bool
    

    Gets whether a descendant item is selected.

    Source

    set_is_child_selected

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

    Sets whether a descendant item is selected.

    Source

    menu_items

    fn menu_items(self: &Self) -> ItemCollection
    

    Gets the child items (writable, also while MenuItemsSource is set, as in WinUI).

    Source

    menu_items_source

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

    Gets the source of the child items.

    Source

    set_menu_items_source

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

    Sets the source of the child items.

    Source

    Trait implementations

    Availability

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