MVVM conform localization in WPF Applications

霸气de小男生 提交于 2019-12-03 02:39:48

This is the appropriate way to do it, as far as I'm concerned. To switch languages, change the culture used by the localization class:

localization.Culture = CultureInfo.GetCultureInfo( "de-DE" );

Since all strings are fetched at runtime (all calls in the generated Designer.cs files look like ResourceManager.GetString( "SomeString", resourceCulture ); and resourceCulture is what gets set by the call above, this affects what you get at runtime. However supose you use the values in menu items etc from within xaml, you have to rebuild the entire menu before this takes effect.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!