I am using MahApps and AvalonDock for my WPF application, AvalonDock tab header icon can only accept URI icon source. However, from my understanding MahApps icon need to set like below:
<MenuItem.Icon>
<iconPacks:PackIconMaterial Kind="Close" Foreground="Red" />
</MenuItem.Icon>
But AvalonDock does not accept this when I bind the icon property from the respective ViewModel, how can I change this MahApps icon into URI?
If you look on the GitHub Wiki then you will find the class
MenuItemExwhich allows you to use theIconTemplateproperty.With this you can set the Icon like this:
It's also possible to use the PackIcon Image MarkupExtensions to get an Image:
Or anywhere else where an ImageSource is needed.