Sunday, 1 August 2010

WPF Commands

Q. What happens if we define both the Command for a button and also provide handler for its click event?

A. The click event's handler fires first, and then the command.

Q. Can we assign add a command twice to the CommandBindings collection with different execute event handler?

A. Through testing it looks only one execute handler is fired. The first binding which is added to the collection gets invoked.

Q. Can we do something additional when the built-in commands are fired? For example we want to do something more when a copy command is invoked. Adding a new binding for Application.Copy does not work. (refer previous question) Or if we can't extend can override the Application.Cut behavior?

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

C# Reactive Extensions - Buffer and Window

I was going through Buffer and Window in RX, thought a few examples would help clear the differences. First create a buffer of even numbe...