O'Reilly logo

Pro WPF in C# 2008: Windows Presentation Foundation with .NET 3.5, Second Edition by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

WPF Events

Now that you've learned how WPF events work, it's time to consider the rich variety of events that you can respond to in your code. Although every element exposes a dizzying array of events, the most important events usually fall into one of four categories:

  • Lifetime events. These events occur when the element is initialized, loaded, or unloaded.

  • Mouse events. These events are the result of mouse actions.

  • Keyboard events. These events are the result of keyboard actions (such as key presses).

  • Stylus events. These events are the result of using the penlike stylus, which takes the place of a mouse on a Table PC.

Taken together, mouse, keyboard, and stylus events are known as input events.

Lifetime Events

All elements raise events when ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required