将自定义命令绑定到按钮 [英] Bind Custom Commands to Button

查看:81
本文介绍了将自定义命令绑定到按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



是否可以将多个命令绑定到WPF按钮?
我有一些自定义命令,一些按钮应该执行
单击2或3个命令.
如果在WPF中可行,我该如何实现?

问候Moti

Hi,

Is it possible to bind more than one Command to a WPF Button?
I have some Custom Commands, and some Buttons should execute
2 or 3 Commands when clicked.
If this is possible in WPF, how do i implement this?

greets Moti

推荐答案

乔什·史密斯(Josh Smith)在他的实现中有一篇非常好的文章,叫做命令组"(Command Group) http://msdn.microsoft.com/en-us/library/cc707894.aspx [ ^ ]
Josh Smith has a very good article on his implementation called a "Command Group" Aggregating WPF Commands with CommandGroup[^]

Prism has a class builtin for this called the CompositeCommand. Ref: http://msdn.microsoft.com/en-us/library/cc707894.aspx[^]


这篇关于将自定义命令绑定到按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆