How to use resource files in XAML (xamarin forms) like <Label Text="MyApp.resouces.MyString" />?
There is a nice article here covering this topic. It includes lot of examples.
After you implement your TranslateExtension your code will look like this:
<Label x:Name="lblName" Text="{local:TranslateExtension MyString}" />
Your App.axml file:
<Application xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Master.App">
<Application.Resources>
<!-- Application resource dictionary -->
<ResourceDictionary>
<x:String x:Key="AppName">Name of app</x:String>
</ResourceDictionary>
</Application.Resources>
</Application>
And then your label:
<Label Text="{StaticResource AppName}"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With