Weird problem where Button does not get re-enabled unless the mouse is clicked

后端 未结 3 1774
时光取名叫无心
时光取名叫无心 2020-12-06 16:08

My app is written using the MVVM pattern in WPF, and all of my Buttons use Command bindings to execute code in my model. All commands have code in CanExecute to determine t

3条回答
  •  青春惊慌失措
    2020-12-06 16:51

    WPF doesn't update command bound controls unless it has a reason to. Clicking on the GUI causes WPF to refresh so the update then works.

    You can manually cause a refresh of any command bound controls by calling CommandManager.InvalidateRequerySuggested.

提交回复
热议问题