Why is this WPF RoutedCommand bound Context MenuItem disabled?

前端 未结 5 2073
北恋
北恋 2020-12-19 06:46

I\'m still fumbling my way around WPF at the moment, and can not figure out why this context menu item is disabled:



        
5条回答
  •  鱼传尺愫
    2020-12-19 07:40

    An even simpler answer would be to add a call to Focus() in the Window's constructor. I bumped into this issue yesterday and spent quite a bit of time figuring out what was going on. I blogged about it here: http://cebla5.spaces.live.com/blog/cns!1B8262ED00250003!206.entry

    The blog post will explain why calling Focus() in the constructor works.

提交回复
热议问题