Is there a way to refresh all bindings in WPF?

后端 未结 3 818
盖世英雄少女心
盖世英雄少女心 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条回答
  •  萌比男神i
    2021-02-07 02:07

    You can null then re-set the DataContext of the parent object.

    DataContext = null;
    DataContext = data;
    

提交回复
热议问题