O'Reilly logo

Microsoft® Visual C#® 2008 Step by Step by John Sharp

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

Understanding WPF User Interface Events

As mentioned earlier, the .NET Framework classes and controls used for building graphical user interfaces (GUIs) employ events extensively. You'll see and use GUI events on many occasions in the second half of this book. For example, the WPF Button class derives from the ButtonBase class, inheriting a public event called Click of type RoutedEventHandler. The RoutedEventHandler delegate expects two parameters: a reference to the object that caused the event to be raised and a RoutedEventArgs object that contains additional information about the event:

public delegate void RoutedEventHandler(Object sender, RoutedEventArgs e);

The Button class looks like this:

public class ButtonBase: ... { public event RoutedEventHandler ...

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