Force UI update on the fly, after changing current culture in WPF

前端 未结 3 1067
忘了有多久
忘了有多久 2021-02-04 07:31

I need to support UI language change through the application menu. The texts are localized using resource files (similar to approach 1 here)

if I set the Thread.Cu

3条回答
  •  野性不改
    2021-02-04 08:02

    Assuming the DataContext for the menu is an object that implements INotifyPropertyChanged, you can refresh all controls by specifying null (nothing) in the PropertyChanged event...

    from msdn:

    The PropertyChanged event can indicate all properties on the object have changed by using either a null reference (Nothing in Visual Basic) or String.Empty as the property name in the PropertyChangedEventArgs.

提交回复
热议问题