Reputation: 1643
I'm trying to use icon font from weather-icons in an UWP application.
In my XAML I have something like
<Grid.Resources>
<FontFamily x:Key="WeatherFonts">/Assets/Fonts/weathericons-regular-webfont.ttf#Weather Icons</FontFamily>
</Grid.Resources>
<TextBlock x:Name="tbFontAwesome"
Text="{Binding CurrentWeather.Icon}"
FontFamily="{StaticResource WeatherFonts}"
Foreground="White"
FontSize="72"/>
In my ViewModel I'm setting the
CurrentWeather.Icon = ""
If I just hardcode this in the XAML, it works fine.
<TextBlock x:Name="tbFontAwesome"
Text=""
FontFamily="{StaticResource WeatherFonts}"
Foreground="White"
FontSize="72"/>
When I use the hardcoded XAML, the icon shows up just fine, but if I try doing the binding to the string, the TextBlock
just shows the string and not the icon.
Upvotes: 3
Views: 193