Keyboard events in a WPF MVVM application?

前端 未结 8 1899
情深已故
情深已故 2020-11-27 11:30

How can I handle the Keyboard.KeyDown event without using code-behind? We are trying to use the MVVM pattern and avoid writing an event handler in code-behind file.

8条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-27 12:10

    Similar to karlipoppins answer, but I found it didn't work without the following additions/changes:

    
        
            
        
    
    

提交回复
热议问题