If we can't bind a MouseBinding's Command, what are we supposed to do?

∥☆過路亽.° 提交于 2019-12-01 05:58:28

You could always take a look at using Attached Command Behaviours.

Originally I believe I was referring to the use of TextBlock's InputBindings member.

In .NET 4 InputsBindings now inherit from Freezable, so now the Command property is dependency property (see Binding support in InputBindings), solving the binding issue.

If you are stuck with .NET 3.5 you could create some attached properties for any type of event that you want. In your OnCommandChanged function add the event handler, and filter based on modifiers (like the Control key or the ClickCount) in your PropertyChangedCallback method.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!