Chris
Chris

Reputation: 433

Timepicker control?

Is there an easy way to make a number picker for windows phone 7 that looks like a timepicker control? I want go have custom ranges of 0-99 : 0-59 . 0-9 while keeping the native windows phone look. Google, bing, and msdn seem to be very vague with information on the subject.

I found an article that describes exactly what I want to do here. My problem is that the article is old and if I type toolkit: in my XAML code, no suggestion comes up for a loopingselector. If I go into my toolbox, right click, choose items. There are no controls for a loopingselector or infinite list selector.

The source code also doesn't work.

I am kind of at a loss on what to do here.

I am using Visual Studio 2010 / c#4.0.

Upvotes: 1

Views: 1553

Answers (2)

Boryana Miloshevska
Boryana Miloshevska

Reputation: 2730

Make sure that you are using the right namespace. LoopingSelector is in Microsoft.Phone.Controls.Primitives namespace. So your xmlns should be something like:

xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls.Toolkit"

Upvotes: 1

Richard Banks
Richard Banks

Reputation: 12546

The easiest way is to add a reference to the recent August WP7 Silverlight Toolkit release to your project using NuGet and then add the following namespace reference to the top of your xaml

<phone:PhoneApplicationPage
    ...
    xmlns:toolkitPrimitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls.Toolkit"
/>

You should then be able to use code like this:

<toolkitPrimitives:LoopingSelector ... />

Upvotes: 4

Related Questions