如何将循环选择器添加到 Windows Phone 8.1 应用程序? [英] How to add a looping selector to a Windows Phone 8.1 app?

查看:31
本文介绍了如何将循环选择器添加到 Windows Phone 8.1 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将如下图所示的数字列表添加到 Windows Phone 8.1 应用程序的页面中,但我在工具箱中找不到循环选择器控件来实现此目的:

如果工具包安装成功,参考文件夹应该是这样的

然后将 Primitive 命名空间添加到 XAML 文件中.

然后就可以使用循环选择器了.

<primitives:LoopingSelector.ItemTemplate><数据模板><!-- 设计您自己的方框+文本--></数据模板></primitives:LoopingSelector.ItemTemplate></toolkit_primitives:LoopingSelector>

<小时>

Intellisense 也应该接收它

I'm trying to a add a list of numbers like in the picture below to a page in a Windows Phone 8.1 app, but I can't find the looping selector control in the toolbox to acheive this:

http://www.geekchamp.com/articles/wp7-loopingselector-in-depth--part1-visual-structure-and-api

I've tried to add the missing control by right clicking on the toolbox and adding a control but its not there.

This is how I've achieved picking a time using the coding4fun time span picker:

<c4fToolkit:TimeSpanPicker Header="Rest Interval" x:Name="restTimeSpanPkr" Max="12:59:59" Step="1:1:1" Margin="-12,323,12,-278" Grid.RowSpan="2"/>

Does anyone have any idea how to add the missing tool or is there a different way of achevingthis in Windows phone 8.1?

解决方案

Install the Windows Phone Toolkit using NuGet or download it on their website: The Windows Phone Toolkit

If the toolkit is successfully installed the reference folder should look like this

Then add the Primitive namespace to the XAML file.

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

Then you can use the looping selector.

<toolkit_primitives:LoopingSelector>
    <primitives:LoopingSelector.ItemTemplate>
        <DataTemplate>
             <!-- design your own square box+text -->
        </DataTemplate>
    </primitives:LoopingSelector.ItemTemplate>      
</toolkit_primitives:LoopingSelector>


Intellisense should pick it up as well

这篇关于如何将循环选择器添加到 Windows Phone 8.1 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆