Question : WPF: When might I want a class in the toolbar?

I am new to WPF, but read some interesting things.  Like that instead of just putting an event handlers into the toolbar, I could associate a class with a button.

What can I do with that kind of power?

I can't think of a thing...

Thanks,
newbieweb

Answer : WPF: When might I want a class in the toolbar?

class listeners have the opportunity to respond to the routed event before any instance listener on the element can. For this reason, class handlers are sometimes used to suppress routed events that a particular control class implementation does not wish to propagate further, or to provide special handling of that routed event that is a feature of the class. For instance, a class might raise its own class-specific event that contains more specifics about what some user input condition means in the context of that particular class. The class implementation might then mark the more general routed event as handled. Class handlers are typically added such that they are not invoked for routed events where shared event data was already marked handled, but for a typical cases there is also a RegisterClassHandler(Type, RoutedEvent, Delegate, Boolean) signature that registers class handlers to invoke even when routed events are marked handled.

reference http://msdn.microsoft.com/en-us/library/ms747183.aspx
Random Solutions  
 
programming4us programming4us