Skip to content
Jan Karger ツ ☀ edited this page Dec 18, 2019 · 6 revisions

MarkupExtensions (WPF and UWP)

A faster way to get an Icon for any ContentControl is to use the PackIcon MarkupExtension(s).

If you want e.g. a Button with an Icon from the PackIconFontAwesome then you can do this:

<Button Content="{iconPacks:FontAwesome StarRegular}" />

<!-- or -->

<Button Content="{iconPacks:FontAwesome Kind=StarRegular}" />

2019-12-18_10h45_01

It's also possible to use some properties of the MarkupExtension like this:

<Button Content="{iconPacks:FontAwesome SpinnerSolid, Width=32, Height=32, Spin=True, SpinDuration=3}" />

iconpacks_spinner

Genral (generic) MarkupExtension (only WPF)

There is also a general (generic) MarkupExtension available (only WPF). With this MarkupExtension you can use any IconPack enumeration.

<Button Content="{iconPacks:PackIcon {x:Static iconPacks:PackIconMaterialKind.Cookie}, Width=32, Height=32}" />

2019-12-18_10h49_23