charri / Font-Awesome-WPF

FontAwesome controls for WPF+UWP
MIT License
530 stars 147 forks source link

CssClassNameConverter should also accept "fa-" prefixed class names #43

Open drewnoakes opened 7 years ago

drewnoakes commented 7 years ago

For example, from http://fontawesome.io/icon/wpforms/:

image

The string used on the site is fa-wpforms, but CssClassNameConverter expects wpforms.

I worked around this with code such as:

var faConverter = new CssClassNameConverter();

var converter = LambdaConverter.Create<string>(s =>
{
    if (s.StartsWith("fa-"))
        s = s.Substring(3);
    return faConverter.Convert(s, typeof(FontAwesomeIcon), null, null);
});

But it would be better if the library did this.