Skip to content

Easily use Segoe MDL2 Assets in your C# project (Xamarin, UWP, WPF)

License

Notifications You must be signed in to change notification settings

hassou/SegoeMDL2AssetsFontClass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SegoeMDL2AssetsFontClass

Unofficial Segoe MDL2 Assets Font Class C#

image

Easily use Segoe MDL2 Assets in your C# project (Xamarin, UWP, WPF)

Xamarin.Forms demo

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:

image

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

image

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>

About

Easily use Segoe MDL2 Assets in your C# project (Xamarin, UWP, WPF)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages