DatePicker

The DatePicker control is also new in the .NET Framework 4.0 and shows a pop-up calendar where you can pick a date; the date is then bound to a text box placed near the control. The DatePicker is used in data-binding techniques (see Chapter 35). The following XAML code shows how you can implement a DatePicker; the selection, which is mapped by the SelectedDate property of type Date, is then bound to a second, external text box to demonstrate how the value can be consumed by other user controls:

image

Figure 32.5 shows how the DatePicker appears.

Figure 32.5 Implementing a DatePicker.

image

The DatePicker exposes an event called SelectedDateChanged that is raised when the user selects another date. The following event handler shows an example of handling the event:

image

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.117.231