Menu Icon usage in WPF with NuGet Package WPF-Icons

RobDev 451 Reputation points
2026-07-05T12:34:21.2533333+00:00

Hello All,

I'm attempting to create a menu for my app and I thought it would be nice if I were to add Icons to my menu items. So I found a NuGet package (WPF-Icons2.0.0) and added to my solution. Unfortunately, I now have no idea of how to specify which icon I want to use. I followed the instructions on the NuGet website (Link: https://www.nuget.org/packages/WPF-Icons ) on how to integrate the package into my solution and that worked. However, so far the code that I've written to choose the icon I want is shown next and it doesn't work:

<Menu Grid.Row="0">
        <MenuItem Header="Adjust Colours" >
            <i:Icon i:Name="close" />
        </MenuItem>
</Menu>

Does any body know how to access the different icons in the package?

All help gratefully received.

Developer technologies | Windows Presentation Foundation
0 comments No comments

Answer accepted by question author
Danny Nguyen (WICLOUD CORPORATION) 8,725 Reputation points Microsoft External Staff Moderator
2026-07-06T03:58:28.4166667+00:00

Hi @RobDev ,

Glad to hear you got it working.

The original XAML did not work because i:Name="close" only names the XAML element. It does not select which icon should be displayed.

For this package, the icon is selected through the Kind property. The value should include the icon_ prefix plus the icon name, for example:

<Menu Grid.Row="0">
    <MenuItem Header="Adjust Colours">
        <MenuItem.Icon>
            <i:Icon i:Kind="icon_close" />
        </MenuItem.Icon>
    </MenuItem>
</Menu>

So in this case, the important part is:

<i:Icon i:Kind="icon_close" />

Here, icon_close tells the WPF-Icons control to render the close icon.

You can also place the icon directly as you tested, but using MenuItem.Icon is the usual WPF pattern for showing an icon beside a menu item. You can read more about the WPF side in the MenuItem.Icon property, and the available Kind usage is described on the WPF-Icons NuGet page.

If you found my response helpful or informative, I would greatly appreciate it if you could follow this guidance or provide feedback.

Thank you. 

Was this answer helpful?

1 person found this answer helpful.

1 additional answer

Sort by: Newest
  1. RobDev 451 Reputation points
    2026-07-05T13:17:17.7966667+00:00

    Hello All (again),

    sorry to have bothered you but it seems that I didn't read the website info correctly. What I should have coded is:

    <Menu Grid.Row="0">
            <MenuItem Header="Adjust Colours" >
                <i:Icon i:Kind="icon_close" />
            </MenuItem>
    </Menu>
    

    As the website says the 'Kind' property defines the icon symbol 'icon_' is the symbol prefix and 'close' is its name.

    Anyway it all seems to work now.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.