문제

I have a Longlistselector that is getting the text through data binding. 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

_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#.

So use AppResources.UsText01 like so

_UserAdBL.Add(new UserAdB(AppResources.UsText01));
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top