WPF - How to force a Command to re-evaluate 'CanExecute' via its CommandBindings

前端 未结 6 1265
礼貌的吻别
礼貌的吻别 2020-11-29 17:47

I have a Menu where each MenuItem in the hierarchy has its Command property set to a RoutedCommand I\'ve defined. The as

6条回答
  •  余生分开走
    2020-11-29 18:04

    Not the prettiest in the book, but you can use the CommandManager to invalidate all commandbinding:

    CommandManager.InvalidateRequerySuggested();
    

    See more info on MSDN

提交回复
热议问题