[英]Localize text that is already data binding? WP8
I have a Longlistselector that is getting the text through data binding. 我有一个Longlistselector通过数据绑定获取文本。 My problem is I need it to be localized so it displays the right language, how is the right way to do it? 我的问题是我需要将其本地化,以便显示正确的语言,正确的方法是什么?
I tried the first way that came to my head, but I thought it doesn't work: 我尝试了第一种想到的方法,但我认为它不起作用:
MainPage.cs MainPage.cs
_UserAdBL.Add(new UserAdB("{Binding LocalizedResources.UsText01, Source={StaticResource LocalizedStrings}}"));
Any help will be appreciated, thanks! 任何帮助将不胜感激,谢谢!
If I understand you correctly, you want to get the value of the {Binding LocalizedResources.UsText01, Source={StaticResource LocalizedStrings}}
XAML binding in C#. 如果我对您的理解正确,则想获取C#中的{Binding LocalizedResources.UsText01, Source={StaticResource LocalizedStrings}}
XAML绑定的值。
So use AppResources.UsText01
like so 所以像这样使用AppResources.UsText01
_UserAdBL.Add(new UserAdB(AppResources.UsText01));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.