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.
Members
TYPEto_reficon_propertyinfo_badge_propertycompact_pane_length_propertyselects_on_invoked_propertyis_expanded_propertyhas_unrealized_children_propertyis_child_selected_propertymenu_items_propertymenu_items_source_propertyconstructnewiconset_iconinfo_badgeset_info_badgecompact_pane_lengthselects_on_invokedset_selects_on_invokedis_expandedset_is_expandedhas_unrealized_childrenset_has_unrealized_childrenis_child_selectedset_is_child_selectedmenu_itemsmenu_items_sourceset_menu_items_source
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<NavigationViewItem>
Returns a strong reference to this object.
icon_property
fn icon_property() -> &'static StyledProperty<Option<Ref<IconElement>>>
Defines the Icon property: the icon of the item.
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.
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).
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.
is_expanded_property
fn is_expanded_property() -> &'static StyledProperty<bool>
Defines the IsExpanded property: whether the child items are shown.
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.
is_child_selected_property
fn is_child_selected_property() -> &'static StyledProperty<bool>
Defines the IsChildSelected property: whether a descendant item is selected.
menu_items_property
fn menu_items_property() -> &'static DirectProperty<NavigationViewItem, ItemCollection>
Defines the MenuItems property: the child items (read-only; the collection is writable).
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.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
Creates an item.
icon
fn icon(self: &Self) -> Option<Ref<IconElement>>
Gets the icon.
set_icon
fn set_icon(self: &Self, value: Option<Ref<IconElement>>)
Sets the icon.
info_badge
fn info_badge(self: &Self) -> Option<Ref<InfoBadge>>
Gets the info badge.
set_info_badge
fn set_info_badge(self: &Self, value: Option<Ref<InfoBadge>>)
Sets the info badge.
compact_pane_length
fn compact_pane_length(self: &Self) -> f64
Gets the compact pane length of the navigation view of the item.
selects_on_invoked
fn selects_on_invoked(self: &Self) -> bool
Gets whether invoking the item selects it.
set_selects_on_invoked
fn set_selects_on_invoked(self: &Self, value: bool)
Sets whether invoking the item selects it.
is_expanded
fn is_expanded(self: &Self) -> bool
Gets whether the child items are shown.
set_is_expanded
fn set_is_expanded(self: &Self, value: bool)
Sets whether the child items are shown.
has_unrealized_children
fn has_unrealized_children(self: &Self) -> bool
Gets whether the item has children the application adds when it expands.
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.
is_child_selected
fn is_child_selected(self: &Self) -> bool
Gets whether a descendant item is selected.
set_is_child_selected
fn set_is_child_selected(self: &Self, value: bool)
Sets whether a descendant item is selected.
menu_items
fn menu_items(self: &Self) -> ItemCollection
Gets the child items (writable, also while MenuItemsSource is set, as in WinUI).
menu_items_source
fn menu_items_source(self: &Self) -> Option<ItemsSource>
Gets the source of the child items.
set_menu_items_source
fn set_menu_items_source(self: &Self, value: Option<ItemsSource>)
Sets the source of the child items.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeTemplatedControlImplExtContentControlImplExtControlImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<NavigationViewItem>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleStyledElementImplInteractiveImplContentControlImplFerroObjectImplVisualImplControlImplLayoutableImplInputElementImplTemplatedControlImplDrop
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.