Hello,
in this blog I'm going to talk about DataPicker Control in windows phone 7
I used it in my application How old
The DatePicker looks:
first, you should download The Windows Phone Toolkit from here: http://goo.gl/L1H0j
After installing the toolkit, press Ctrl+Shift+N to create a new project
then add a reference to the silverlight toolkit dll, right-click on the
then the code is
-create a new folder and name it "Toolkit.Content"
-copy the icons from C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.1\Toolkit\Oct11\Bin\Icons
They must be named "ApplicationBar.Check.png" and "ApplicationBar.Cancel.png", The Build Action must be "Content".
you can customize the Date format
<toolkit:DatePicker x:Name="datePicker" Value="2/3/2010" ValueStringFormat="{}{0:D}"/>
The standard for date formats: http://msdn.microsoft.com/en-us/library/az4se3k1%28v=VS.95%29.aspx
you can also add a header
for example ValueChanged
private void datePicker_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
{
textBox1.Text = datePicker.ValueString;
}
in this blog I'm going to talk about DataPicker Control in windows phone 7
I used it in my application How old
The DatePicker looks:
first, you should download The Windows Phone Toolkit from here: http://goo.gl/L1H0j
Straight from Microsoft, both the Silverlight Toolkit and Silverlight for Windows Phone Toolkit provide the developer community with new components, functionality, and an efficient way to help shape product development. Toolkit releases include open source code, samples & docs.The toolkit provides many useful components like AutoCompleteBox, DatePicker, DateTimeConverters, GestureService, PerformanceProgressBar, TimePicker, WrapPanel, and more....
After installing the toolkit, press Ctrl+Shift+N to create a new project
References
item for your project and choose Add Reference, then add
Microsoft.Phone.Controls.Toolkit and press ok
in the xaml code, you should add toolkit prefix declaration
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
then the code is
<toolkit:DatePicker x:Name="datePicker" Value="2/3/2010"/>then you should add the applicationBar Icons
-create a new folder and name it "Toolkit.Content"
-copy the icons from C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.1\Toolkit\Oct11\Bin\Icons
They must be named "ApplicationBar.Check.png" and "ApplicationBar.Cancel.png", The Build Action must be "Content".
you can customize the Date format
<toolkit:DatePicker x:Name="datePicker" Value="2/3/2010" ValueStringFormat="{}{0:D}"/>
The standard for date formats: http://msdn.microsoft.com/en-us/library/az4se3k1%28v=VS.95%29.aspx
you can also add a header
Header="DatePicker"There are many events you can use
for example ValueChanged
private void datePicker_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
{
textBox1.Text = datePicker.ValueString;
}