Unofficial Segoe MDL2 Assets Font Class C#
Easily use Segoe MDL2 Assets in your C# project (Xamarin, UWP, WPF)
In your shared project, add Segoe MDL2 Assets font, that you can grab from Windows Fonts, and one of the FontClass files from the repo, to your project like this:
Make sure that the Build Action of the font file (SEGMDL2.ttf) is set to Embedded resource. Add the namespace of your project to FontClass cs file
Add this line anywhere in your project (preferably in the assemblyInfo.cs file)
[assembly: ExportFont("SEGMDL2.TTF", Alias = "IconFont")]
You can then use the font in your XAML or C# project
Label label = new Label{
FontFamily = "IconFont",
Text = IconFont.Edit
}
If you want to use it with XAML, add your project namspace:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:mdl="clr-namespace:CardsGame"
x:Class="CardsGame.DemoPage">
<Label FontFamily="IconFont" Text="{x:Static mdl:IconFont.Edit}"/>
</ContentPage>