Skip to content

Easily use Google's Material Symbols and Material Design icon codes in C#.

License

Notifications You must be signed in to change notification settings

matthewrdev/md2cs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

Use MaterialSymbols.cs (or MaterialIcons.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 = "/ue869";

Becomes this:

// Obviously a build icon from Material Symbols! 😊👍
submitButton.Text = MaterialSymbols.Build;

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

Using Material Design To C#

It's super easy to use MaterialDesign To C#.

Simply download the class for your desired Material Design icon set (see below), place it into your project and start using it.

You should also ensure that you have added the corresponding Material Design font file(s) into your projects.

You can use an icon in C# like so:

var fileIcon = MaterialSymbols.Build;

You can use an icon in XAML by:

  • Adding a namespace reference to MaterialDesign: xmlns:md="clr-namespace:MaterialDesign";
  • Referencing a icon using x:Static: <Label Text="{x:Static md:MaterialSymbols.Build}"/>

Voila! All done!

Downloads

Material Symbols

Material Icons

Using FontAwesome?

If you're using FontAwesome, check out fa2cs, a static class file containing string constants for all FontAwesome icon codes.

About

Easily use Google's Material Symbols and Material Design icon codes in C#.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages