开发者

Multiple Keybinding to a single command

My window has just a listview. This facilitates the users to incremental search the db. Since the design does not have a textbox, i've to globally handle the keys. I think it could be achieved by k开发者_运维问答eybinding. But how can i handle all the keys and associate it to a single command.

Also suggest me other methods if any.

P.S.: I want this in xaml


I would use an EventToCommand binding the KeyDown event to a command on the ViewModel. You can set PassEventArgsToCommand to true, and use a RelayCommand to find out what key as pressed.

All these objects are available in the MVVM Light Toolkit

http://www.galasoft.ch/mvvm/getstarted

Cheers, Laurent

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜