在XAML中使用多种语言资源

tf7tbtn2  于 2022-12-07  发布在  其他
关注(0)|答案(1)|浏览(134)

I have around 3 languages resources(.RESX) file and I would like to use them in XAML as I use in CS file with no problem.
My cs code is like this: Properties.Resources.ResourceManager.GetString("Key")
And It's working but I need to use the same dictionary file to XAML file as well.
I made some searchs but didn't find a way to solve my problem.
The language change is trigged by another program, so I cannot set manually it.

mrphzbgm

mrphzbgm1#

可以将XAML中的资源与x:Uid一起使用

<TextBlock x:Uid="TextBlock" Text="This will be overriden"/>

然后,您可以拥有资源TextBlock.Text,它将设置任何具有x:Uid“TextBlock”的控件的Text属性

相关问题