Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Added: markup extension #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added: markup extension #31

wants to merge 1 commit into from

Conversation

VolodymyrBaydalka
Copy link

Markup extention to convert from FontAwesomeIcon to string without bindings. Useful for styles and document element such Run, etc.

Example:

<TextBlock>
  Info <Run Text="{fa:FontAwesome InfoCircle}" FontFamily="pack://application:,,,/FontAwesome.WPF;component/#FontAwesome"/>
</TextBlock>

@drewnoakes
Copy link
Contributor

Why not also add:

FontFamily="{fa:FontFamily}"

It's a shame to see such little response from the owner of this repo.

@charri
Copy link
Owner

charri commented Oct 6, 2016

I'm always a bit weary on long strings floating around the place.
Would it be worth creating a second markup extension just for setting the font?

@charri
Copy link
Owner

charri commented Oct 6, 2016

Well it helps to read stuff before posting! @drewnoakes had already posted what I was refering to :) - woops!

@VolodymyrBaydalka
Copy link
Author

VolodymyrBaydalka commented Oct 7, 2016

Reason for this markup extension was that I'm tired of searching for codes for icons. Especially when you need to work with run's

With font family there is no such a problem. You can define own style or static resource for it

<FontFamily x:Key="FontAwesomeFamily">pack://application:,,,/FontAwesome.WPF;component/#FontAwesome</FontFamily>
...
<TextBlock FontFamily="{StaticResource FontAwesomeFamily}"

I don't think that worth to create another markup extension. Maybe just define a shared static resource

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants