Use Iconpack as Image
See original GitHub issueHi everyone
I want to use some Icons if this Pack as Images, so everthink looks the same. But i don’t know how to access the Images …
`xmlns:iconPacks=“http://metro.mahapps.com/winfx/xaml/iconpacks”
this works : <Button Content=“{iconPacks:PackIconMaterial Settings}”
here i wan’t to use the Image … This doesn’t work : <myWPF:ImageButton Image=“{iconPacks:PackIconMaterial Settings}” `
So how can i get or convert the iconPacks to an Image Source ?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:15 (3 by maintainers)
Top Results From Across the Web
How to bind image to mahapps icon packs? - wpf
I had same problem. I am using a package allows only System.Windows.Controls.Image. I solved from C# side. Lets create a Mahapps Icon
Read more >Need help customizing Icons. Want to use custom picture ...
Hold on the current icon, select Edit Icon -> Edit with Icon Pack Studio, select a base to start, then once the icon...
Read more >[Q] Extracting separate icon files from an icon pack?
Use "ES File Explorer". Go to the apps. Long press the icon pack app and select "share". Then you can save the apk...
Read more >How to use custom icon packs on Samsung One UI 4
Open Theme Park. Tap Icon. Press create new. Select the icon pack button (it's blue and has a gift icon with a bow...
Read more >Q&A: How to use the downloaded icon images (PNG) on ...
On the Edit Shortcut prompt, tap the image icon. Select Gallery apps. Tap Gallery. Select the icon image that you want to use....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I use an IValueConverter for this, which is slightly more useful than a markup extension as you can also use bindings.
For example:
ImageSource="{Binding Source={x:Static iconPacks:PackIconEntypoKind.AddToList}, Converter={common:PackIconEntypoImageSourceConverter}, ConverterParameter={StaticResource TextBrush}}"or like this:
ImageSource="{Binding Path=AddToListIcon, Converter={common:PackIconEntypoImageSourceConverter}, ConverterParameter={StaticResource TextBrush}}"There are absolutely valid reasons for having the icons as an image, as mentioned here already. I’d like to see this added to the IconPacks.
Here’s the full code to the converters I’m using. Feel free to use it as you want. https://gist.github.com/Phyxion/160a6f04e6083016d4b2a3aed3c4fe71
Another application would be using the icons for
RibbonButtonwhich requires aLargeImageSourceand aSmallImageSource.