September 2012
Intermediate to advanced
464 pages
10h 55m
English
Events are essentially notifications from an object to the outside world – a variation on the "observer" design pattern. Most of the time an object is told what to do via properties and methods. Events are its way of talking back to whoever is interested. The concept of events existed in .NET since its inception, but WPF has something to say about the way events are implemented. WPF introduces routed events, an enhanced infrastructure for raising and handling events, which we'll look at in this recipe.
Make sure Visual Studio is up and running.
We'll create a simple drawing application that uses routed events to handle user interaction:
CH01.SimpleDraw. This will ...