I did everything exactly as in this simple guide of how to access strings from another file anywhere in the Xamarin.forms project (in xaml and c#).
(https://learn.microsoft.com/de-de/xamarin/xamarin-forms/app-fundamentals/localization/text?pivots=windows)
However, it will simply not found my resouces, even If I set the build options to embedded resource.
THIS DOESNT WORK:
<Label
Grid.Row="1"
Grid.Column="1"
FontFamily="arial"
FontSize="12"
TextColor="#272727"
Text="{x:Static local:AppResources.BgColor}"
HorizontalOptions="Start"
VerticalOptions="Start"/>
Screenshot of resx file and browser
It should work accordning to the manual but im getting: "Type AppResources not found in xmlns dr-namespace:app4.Renderer.
Please help me out here. Otherwise I have so many hardcoded strings in code and xaml files...
Thank you!
In the XAML file, add:
xmlns:resources="clr-namespace:MyApp.Resx"
MyApp = namespace; Resx = folder where the resource file is
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