-
Notifications
You must be signed in to change notification settings - Fork 224
MarkupExtensions
Jan Karger ツ ☀ edited this page Dec 16, 2019
·
6 revisions
A faster way to get a Button (or any other ContentControl) with an Icon is to use the MarkupExtension(s).
If you want e.g. a Button with an Icon from the PackIconFontAwesome then you can do this one:
<Button Content="{iconPacks:FontAwesome StarRegular}" />
<!-- or -->
<Button Content="{iconPacks:FontAwesome Kind=StarRegular}" />It's also possible to change some properties of the icon itself like this:
<Button Content="{iconPacks:FontAwesome SpinnerSolid, Width=32, Height=32, Spin=True}" />It's also possible to use a general (generic) MarkupExtension:
<Button Content="{iconPacks:PackIcon {x:Static iconPacks:PackIconMaterialKind.Cookie}, Width=32, Height=32}" />