Xamarin forms Wpf Icon Font

After a few tries i finally have to ask how to get custom fonts working for the WPF platform.

my current state of my WPF renderer looks like following:

public class IconLabelRenderer : LabelRenderer { protected override void OnElementChanged(ElementChangedEventArgs<Label> e) { base.OnElementChanged(e); if (e.NewElement != null && Control!= null) { Console.WriteLine(e.NewElement.FontFamily); Control.FontFamily = new FontFamily($"pack://application:,,,/Fonts/{e.NewElement.FontFamily}.ttf#{e.NewElement.FontFamily}"); } } }

I Export it as usual, but i think there must be something is miss right now.

Sign In or Register to comment.