Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add custom icons in NavigationViewMenuItems in UWP

I am trying to use NavigationView with custom icons as Menu Items in my UWP app. However, it seems NavigationView don't accept custom icons or BitmapIcon. The sample application I have seen in android is below; Sample Icons / Image

Sample Code of NavigationView Menu Items

<NavigationView.MenuItems>
   <NavigationViewItem Name="SalahNavItem" Icon="CustomIcon" Content="Apps" Tag="Salah"/>
   <NavigationViewItem Name="AppsNavItem" Icon="CustomIcon1"  Content="Apps" Tag="apps"/>
</NavigationView.MenuItems>

What I am trying to achieve is to add custom Icon / Image in Menu Items, any clue about it in UWP?

like image 605
ARH Avatar asked Dec 06 '22 12:12

ARH


1 Answers

You can add custom Icon Use

<NavigationView.MenuItems>
   <NavigationViewItem Name="SalahNavItem" Icon="CustomIcon" Content="Apps" Tag="Salah">
   <NavigationViewItem.Icon>
                <!-- Use Custom icon <FontIcon Glyph="&#xE10F;"/>
                     Or <BitmapIco UriSource="Path"/> -->
   </NavigationViewItem.Icon>
   <NavigationViewItem Name="AppsNavItem" Icon="CustomIcon1"  Content="Apps" Tag="apps"/>
</NavigationView.MenuItems>

See this link

like image 149
Aravind Belagaje Avatar answered Dec 08 '22 01:12

Aravind Belagaje