Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

Placing a FontImageSource in a ResourceDictionary

$
0
0

I'm trying to add a FontImageSource to a ResourceDictionary so that I can reuse it by referencing a x:Key.

Here's what I have tried, but the compiler doesn't like the way I defined the FontImageSource.

Ideas?

<ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms" 
                xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
                x:Class="App.Themes.ThemeFonts">

<OnPlatform x:Key="FontAwesomeLightFontFamily" x:TypeArguments="x:String"
            Android="fa-light-300.ttf#Font Awesome 5 Pro"
            iOS="FontAwesome5Pro-Light"/>

<FontImageSource 
    x:Key="FontImageSourceBookmark" 
    x:TypeArguments="FontImageSource" 
    FontFamily="FontAwesomeLightFontFamily"
    Glyph="&#xf002;"
    Color="White"
    Size="24"/>


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>