WPF 命令 - 处理程序的调用

发布于 2024-10-09 14:18:00 字数 99 浏览 0 评论 0原文

我是 WPF 的初学者。我读到了有关命令的信息,何时触发命令的处理程序,因为我为按钮和菜单附加了一个 Coomand,处理程序被调用,或者菜单或单击按钮。双击按钮是否可以调用处理程序。

I am a beginner to WPF. I read about commands , when do the handlers for the command get triggered, because i attached a Coomand for the button and a menu , the handler is invoked either the menu or the button is clicked. Is it possible to invoke the handler on double clicking the button.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

流年已逝 2024-10-16 14:18:00

如果我正确理解了查询,那么您将尝试将相同的命令附加到按钮和菜单。那么我应该说该命令将在这两种情况下执行。

检查以下链接。

http://joshsmithonwpf.wordpress.com/2008/03/18/ Understanding-routed-commands/

http://www.codeproject.com/KB /WPF/WPFCommandingTheBasic.aspx

http://www.codeproject.com/KB /WPF/WpfCommandPatternApplied.aspx

双击的情况下,请检查下面的链接

http://www.thejoyofcode.com/Invoking_a_Command_on_a_Double_Click_or_other_Mouse_Gesture.aspx

另请参阅 Marlon Grech 的 附加命令行为。它将为您提供一些附加功能,

这肯定会让您入门。希望它有所帮助

If i understood the query properly then you are trying to attach the same command to both a button and a menu.Then i should say the command will get executed for both the cases.

Check the following links.

http://joshsmithonwpf.wordpress.com/2008/03/18/understanding-routed-commands/

http://www.codeproject.com/KB/WPF/WPFCommandingTheBasic.aspx

http://www.codeproject.com/KB/WPF/WpfCommandPatternApplied.aspx

In the case of double click Check the link below

http://www.thejoyofcode.com/Invoking_a_Command_on_a_Double_Click_or_other_Mouse_Gesture.aspx

Also go through Marlon Grech's attached command behaviors .It will give you a handfull of added functionalities

This will get you started for sure.Hope it helps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文