Chapter 8: Building Desktop Applications with WPF

229

Figure 8-9 The Properties window Events tab

TIP

Controls have default events. The significance of default events is that if you double-click the control in the Designer, VS will generate an event handler for the default event. To be more specific, consider the Button control whose default event is the Click event. If you double-click the Button control in the Designer, VS will generate an event handler for the Click event.

Listing 8-1 A WPF code-behind file

C#:

using System;

using System.Collections.Generic; using System.Linq;

using System.Text; using System.Windows;

using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media;

using System.Windows.Media.Imaging;

Page 252
Image 252
Microsoft 9GD00001 manual 229, Listing 8-1 a WPF code-behind file