Вопрос

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