문제

I have two resource files: StaticData.resx and StaticData.de-ch.resx

After I change my CultureInfo, the UI reflects the change perfectly.

var culture = new CultureInfo(Settings.Default.Localization);
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;

XAML

Title="{x:Static language:StaticData.Title}"

When I try to access this from my code behind, I only get the data from StaticData.resx

var title = StaticData.Title;

What am I doing wrong? According to this link it's supposed to work.

도움이 되었습니까?

해결책

As the var title = StaticData.Title; was called from a different Thread the CultureInfo Need to we set to the correct format again

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top