-
Notifications
You must be signed in to change notification settings - Fork 703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Make Icon of NavigationViewItem templatable #3101
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>
<NavigationViewItem.Content>
<StackPanel Orientation="Horizontal">
<PersonPicture Width="20" Height="20" />
<TextBlock Text="Account" Margin="10,0,0,0" />
</StackPanel>
</NavigationViewItem.Content>
</NavigationViewItem> It would be better if developers could just do this instead: <NavigationViewItem Content="Account">
<NavigationViewItem.Icon>
<PersonPicture Width="20" Height="20" />
</NavigationViewItem.Icon>
</NavigationViewItem> |
Exactly. I read this post earlier, i found this would be the closest to my question #3116 Thanks again for your time @Felix-Dev |
I think this is better than #1488 |
Hello: |
@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. |
Proposal: Make Icon of NavigationViewItem templatable
Summary
Make
Icon
a type ofobject
that can take any element, and add anIconTemplate
property that allows for full customization. The max width of theIcon
element should respect the value ofCompactPaneLength
.Rationale
Icon
property only accepts elements of typeIconElement
, which limits its usage.Scope
The text was updated successfully, but these errors were encountered: