Let me point this out by pointing out: you should use static resources to translate words: Application resources or *. .Resx files
However, if you need to simplify your xaml, the only thing you are missing is placing a datacontext in all your eyes. It seems you are not using MVVM, so placing this logic in the constructor or your code behind gives you access to additional functions through bindings:
public MainPage() {
Then in your xaml, your text fields can simplify this:
<TextBlock Text="{Binding ConverterParameter=Hi, Converter={StaticResource Translator}}"/>
My translator:
public class Translator : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return "Hola!"; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return "Hi!"; } }
source share