Articles in this section
Category / Section

How to add icon to context menu item in WPF Diagram (SfDiagram)?

1 min read

WPF Diagram (SfDiagram) supports adding custom context menu items in the already existing menu or create new menu with custom context menu items. We can add icon for the custom context menu items also.

C#

DiagramMenuItem item = new DiagramMenuItem()
{
  Content = "Delete",
  Command = DiagramCommands.Delete,
  Icon = @"pack://application:,,,/Asset/Delete.png",
};
Diagram.Menu.MenuItems.Add(item);

View Sample in GitHub

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied