How to set and change the culture in WPF

后端 未结 7 1639
孤独总比滥情好
孤独总比滥情好 2020-11-30 00:02

I have a .NET 4.0 WPF application where the user can change the language (culture) I simply let the user select a language, create a corresponding CultureInfo and set:

7条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-30 00:28

    I pretty much had the same issue.

    I found this: http://www.codeproject.com/Articles/35159/WPF-Localization-Using-RESX-Files (might not be the original source).

    It discusses a markup extension named "UICultureExtension" which is attached to the Language property of all framework elements that need localization (in XAML).

    If you raise a UI language changed event, static extension managers in the background will update all registered framework elements.

提交回复
热议问题