question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use Iconpack as Image

See original GitHub issue

Hi 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:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
PhyxionNLcommented, Apr 7, 2017

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

3reactions
wildmichaelcommented, Mar 17, 2017

Another application would be using the icons for RibbonButton which requires a LargeImageSource and a SmallImageSource.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found