Is there a way to refresh all bindings in WPF?

后端 未结 3 766
盖世英雄少女心
盖世英雄少女心 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:46

    How about making "data" a dependency property. Binding your DataContext to that will make your bindings update when you re-assign "data".

提交回复
热议问题