I have a TextBlock bound to a string. I want the string to be displayed in current UI culture of the application. I want to do this in XAML. The text block is simple like below.
<TextBlock Text="{Binding Path=Text}"/>
I have a TextBlock bound to a string. I want the string to be displayed in current UI culture of the application. I want to do this in XAML. The text block is simple like below.
<TextBlock Text="{Binding Path=Text}"/>
Copyright © 2021 Jogjafile Inc.
You need to set the
FrameworkElement.Language
property. The easiest way to do that for the whole application is to override the property metadata in theApp
class static constructor:If you only want to set the culture for a specific control, you can bind its
Language
property to a property of your datacontext: