how can I get a date from the user in Windows Phone? - c#

I should get a date from the user inside a WP 8.1 app, I need something like the DateTimePicker which I use in Windows Forms or the DatePicker of WPF environment, do you know ho to do this?
I tried to search something similar to DatePicker in windows phone but I can't find anything!
My app should get this date to generate a fiscal code, so I need to get the user's birthday.
Is there any tag to add to my xaml file?
Thanks a lot guys!

I think this will solve your problem!
<DatePicker x:Name=birthdayDatePicker Header="Birthday Date"/>

The question is what kind of WP 8.1 app you're developing? Windows Runtime or Silverlight? If the first one, then you can just use DatePicker control, because it's built in.
But, if your app uses Silverlight, then you have to import Windows Phone Toolkit first. You can do it easily: right-click on your project name in Solution Explorer, then choose Manage NuGet Packages.... Type wptoolkit in a search box and you will find Windows Phone Toolkit. Just install it. Now, go to you XAML code and add toolkit namespace:
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
Now you can add DatePicker to your layout:
<toolkit:DatePicker Header="Birthday date"/>

Related

how to implement windows phone style combobox in wpf

I followed this SO question for creating a flat style combobox. It works fine.
I want to implement the combobox with windows phone type of animation effect.
how can I do it? Can anybody please guild me on this?
If you really want to make a combobox for your WP8 application, you must install the Windows Phone Toolkit.
Installation instructions are on their website. You can their get it from NuGet or download the source.
Once installed, you will have to add the namespace in your xaml:
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
Then you can create a ListPicker like so:
<toolkit:ListPicker ItemSource="{Binding YourBindingForList}" />
I hope it will help you.

Dropdown control from system settings

In windows phone settings in several paces presented very interesting control:
What is the name of this control? Where can I find this control?
It's a ListPicker. Not part of the standard controls, but part of the Windows Phone Toolkit (and can be found on NuGet also)

Developing very basic windows 8.1 app. How to perform validation from xaml code behind

hi im developing a very simple windows 8.1 desktop app which i want to do user input validation. to force that some fields are input and also to do some conditional validation. im not doing MVVM etc just xaml with code behind.
can someone point me to a blog/ sample which does this very basic functionality properly?
please help
One option is to use WinRT XAML Toolkit, which offers TextBoxValidationExtensions. You can use them like this:
<TextBox toolkit:TextBoxValidationExtensions.Format="NonEmptyNumeric"/>
It also lets you choose a brush to highlight the textbox when invalid input is entered.
Check out WinRT XAML Validation library.

How to implement drag and drop in c# windows metro app?

I'm developing a metro app for windows store in Visual Studio 2012 using C# and XAML
I want to allow a user to drag a button from a selection and drop it in a specified area.
See the following:
http://social.msdn.microsoft.com/Forums/windowsapps/en-US/53a42865-6e96-4439-85dd-5e90e0ec8512/drag-and-drop-in-metro-apps
Use a grid template and set CanDragItems="True" CanReorderItems="True" and AllowDrop="True".
A comprehensive guide can be found here:
http://blog.jerrynixon.com/2013/06/walkthrough-reordering-items-in.html

AppBar icons in the Toolkit's DateTimePicker

I am building my application in the Windows Phone 8 framework. I am facing the critical problem here. Initially i developed my app using the Telerik's DateTime picker but unfortunately it had some animation and looping problem so i taken the DatePicker from the ToolKit and created the custom control with this. Unfortunately i am not able to access the AppBar of the DatePicker to update it based on my requirements. Is there any option to access the Application bar of the DatePicker in the Toolkit ?. Help can be appreciated.
I had a similar problem and
this worked out great for me.

Categories

Resources