Axemasta / fa2cs

Easily use FontAwesome icon codes in C#.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About

Last Generated for FontAwesome v6.5.1 on Monday, 5 February 2024 10:54:05 (UTC)

Use FontAwesomeIcons.cs to replace confusing and arcane unicode strings with a clean and descriptive property.

This:

// Huh? What icon is this? What font is it from? 😭
submitButton.Text = "/uf00c";

Becomes this:

// Obviously a check icon from FontAwesome! πŸ˜ŠπŸ‘
submitButton.Text = FontAwesome.FontAwesomeIcons.Check;

The end result is cleaner, more readable and more maintainable code.

Get FontAwesomeIcons.cs here

Download the FontAwesome font assets here

Using FontAwesome To C#

It's super easy to use FontAwesome To C#!

Simply download FontAwesomeIcons.cs and place it into your project.

Ensure that you have added the FontAwesome font files into your projects.

You can use an icon in C# like:

var checkIcon = FontAwesome.FontAwesomeIcons.Check;

You can use an icon in XAML by:

  • Adding a namespace reference to FontAwesome: xmlns:fontAwesome="clr-namespace:FontAwesome"
  • Referencing a icon using x:Static: <Label Text="{x:Static fontAwesome:FontAwesomeIcons.Check}"/>

Voila! All done!

Using Material Design Icons?

If you're using the Material Design icon set, check out md2cs, a static class file containing string constants for all Material Design icon codes.

About

Easily use FontAwesome icon codes in C#.

License:MIT License


Languages

Language:C# 100.0%