gpt4 book ai didi

wpf - 在WPF中为ViewModel中的命令分配快捷键

转载 作者:行者123 更新时间:2023-12-03 10:19:58 25 4
gpt4 key购买 nike

Possible Duplicate:
Binding a WPF ShortCut Key to a Command in the ViewModel

On a WPF window I have a menu-item that is bound to a command in the ViewModel:

<MenuItem Header="_Edit page" Command="{Binding EditCommand}"/>

The command is a RelayCommand将命令转发给方法:

EditCommand = new RelayCommand(() => editPage());

我想为命令分配快捷键Ctrl + E。

我应该怎么做?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com