-
-
Notifications
You must be signed in to change notification settings - Fork 212
MarkupExtensions
Jan Karger ツ ☀ edited this page Dec 18, 2019
·
6 revisions
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}" />
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}" />
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}" />