Microsoft 9GD00001 Computer Accessories User Manual


 
Chapter 8: Building Desktop Applications with WPF 229
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;
Figure 8-9 The Properties window Events tab