Is there a way to refresh all bindings in WPF?

后端 未结 3 772
盖世英雄少女心
盖世英雄少女心 2021-02-07 01:38

If my code looks somewhat like the code beneath, would it be possible to refresh all bindings directly or would I have to hard-code all the bindings to refresh?

Service-

3条回答
  •  太阳男子
    2021-02-07 01:54

    Found the answer, seems like that calling PropertyChanged with the PropertyChangedEventArgs property name set to "" refreshes all bindings.
    The DataContext changing worked too, although this felt a bit "cleaner".

提交回复
热议问题