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.

The DatePicker exposes an event called SelectedDateChanged ...

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.