-api-id | -api-type |
---|---|
P:Microsoft.UI.Xaml.Controls.NavigationView.MenuItemTemplate |
winrt property |
Gets or sets the DataTemplate used to display each menu item.
This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).
The template that specifies the visualization of the menu data objects. The default is null.
<NavigationView>
<NavigationView.MenuItemTemplate>
singleDataTemplate
</NavigationView.MenuItemTemplate>
</NavigationView>
or
<NavigationView MenuItemTemplate="resourceReferenceToDataTemplate"/>
- singleDataTemplate
- singleDataTemplateA single DataTemplate object element. That DataTemplate would typically have multiple child elements that define the visual appearance of the data representation.
- resourceReferenceToDataTemplate
- resourceReferenceToDataTemplateA resource reference to an existing DataTemplate from a resources collection. The resource reference must specify the desired DataTemplate by key through a {StaticResource} markup extension usage.