Proposal: Make Icon of NavigationViewItem templatable
See original GitHub issueProposal: Make Icon of NavigationViewItem templatable
Summary
Make Icon
a type of object
that can take any element, and add an IconTemplate
property that allows for full customization. The max width of the Icon
element should respect the value of CompactPaneLength
.
Rationale
- The current
Icon
property only accepts elements of typeIconElement
, which limits its usage.
Scope
Capability | Priority |
---|---|
This proposal will allow developers to display any type of elements they want in the Icon area. | Must |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:11
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Cannot bind Icon property in NavigationView ...
Sadly, it seems the default behaviour is that the contents of MenuItemTemplate are placed inside the NavigationViewItem 's ContentPresenter .
Read more >Icon and IconTemplate - Telerik UI for WPF - Documentation
The RadNavigationViewItem allows you to display a custom icon in its template. To show an icon, you can use either the Icon, or...
Read more >NavigationViewItem.Icon Property - Windows
Gets or sets the icon to show next to the menu item text. Equivalent WinUI 2 API for UWP: Microsoft.UI.Xaml.Controls.NavigationViewItem.Icon (for WinUI in ......
Read more >HamburgerMenu XAML Control - Windows
The 3-line menu icon, which resembles a Hamburger, allows developers to pack more features into their apps or navigation.
Read more >NavigationView In Android
Let's look into the Project Structure of the inbuilt NavigationView template. The activity_main.xml is the layout for the MainActivity.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
One specific example where this would be helpful is developers wanting to show a PersonPicture element as the leftmost element of a NavigationViewItem (see here and here for examples).
Due to the current restrictions of the
NavigationViewItem.Icon
API developers have to use theNavigationViewItem.Content
API instead. If they want to show a content string next to the PdersonPicture, they will have to do all the work for that:It would be better if developers could just do this instead:
@Javier118 In UWP ImageSource supports SVG files. If WinUI3 version of ImageSource doesn’t support it, you’d better to make new proposal for this.