After writing the control before the windows phone7 toolkit, I dropped the two very important controls. For Date Picker and Time Picker, they are actually two controls that I need very much, I have always regretted that Microsoft did not provide it in the early days, but now it has come out, but it has fallen...
DatePicker
This control selects the time control, but the UI on windows phone7 changes a lot. This control can also change the background and text position.
<Toolkit: DatePicker Margin = "41,121, "Name =" datePicker1 "verticalignment =" Top "Height =" 77 "Foreground =" White "HorizontalContentAlignment =" Center "ValueChanged =" datePicker1_ValueChanged ">
<Toolkit: DatePicker. Background>
<ImageBrush ImageSource = "Image/hkd16.jpg"/>
</Toolkit: DatePicker. Background>
</Toolkit: DatePicker>
Private void datePicker1_ValueChanged (object sender, DateTimeValueChangedEventArgs e)
{
E. NewDateTime; // The date selected.
E. OldDateTime; // the original date
}
TimerPicker
This control is used to select the time. After you click it, a ChooseTime page is displayed to select the time. Similarly, a ValueChanged event is triggered to obtain the selected time.
<Toolkit: TimePicker HorizontalAlignment = "Left" Margin = "92,275, 302" Name = "timePicker1" verticalignment = "Top" Width = "" ValueChanged = "timePicker1_ValueChanged"/>
In addition, you can set ValueStringFormat to display the time in different formats. However, because Silverlight does not have this attribute and there are no relevant instructions, you do not know how to set it.
Here, we can see that there is no button image on the Applicationbar after the two controls enter the settings. In fact, this is the case. You need to add a button image to your project. Should this be a bug? Add the Toolkit. Content folder in the project, and put the images of the two buttons. Can these two pictures be downloaded to http://www.52winphone.com/bbs/viewthread.php on my website? Tid = 35 & extra = page % 3D1 toolkit. controls. If you do not want to use these two buttons, you can use the same name.