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:
Figure 32.5 shows how the DatePicker
appears.
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:
52.15.117.231