Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows phone 8 选择将通过web api填充的框_Windows Phone 8_Asp.net Web Api - Fatal编程技术网

Windows phone 8 选择将通过web api填充的框

Windows phone 8 选择将通过web api填充的框,windows-phone-8,asp.net-web-api,Windows Phone 8,Asp.net Web Api,我正在开发一个windows mobile应用程序。但我目前有一项任务需要储备。这是为了创建一个选择框,通过我的web api可以填充世界各地的大陆。我的第一个问题是我没有在WindowsPhone8工具包中看到选择框控件。所以我不知道如何创建一个选择框。我还需要在用户登陆页面时填充选择框的帮助。因为用户需要选择他或她的大陆 当我把它放在我的xaml中时,我得到一个错误,说toolkit前缀未定义 <toolkit:ListPicker Grid.Co

我正在开发一个windows mobile应用程序。但我目前有一项任务需要储备。这是为了创建一个选择框,通过我的web api可以填充世界各地的大陆。我的第一个问题是我没有在WindowsPhone8工具包中看到选择框控件。所以我不知道如何创建一个选择框。我还需要在用户登陆页面时填充选择框的帮助。因为用户需要选择他或她的大陆

当我把它放在我的xaml中时,我得到一个错误,说toolkit前缀未定义

  <toolkit:ListPicker 
                Grid.Column="0"
                Grid.Row="0"
                Grid.ColumnSpan="2"
                x:Name="KListPicker"
                Header="K"               
                ListPickerMode="Normal"
                >

                <toolkit:ListPickerItem Content="K 1" />
                <toolkit:ListPickerItem Content="K 2" />
                <toolkit:ListPickerItem Content="K 3" />
                <toolkit:ListPickerItem Content="K 4" />
                <toolkit:ListPickerItem Content="K 5" />
            </toolkit:ListPicker>

我想这篇文章会对你有所帮助


您正在寻找列表选择器(类似于组合框/选择框)

Listpicker实际上相当于WindowsPhone7的组合框控件。它显示从列表中选择的项目,还允许用户从列表中选择是否要更改的项目。ListPicker是一个标准的ItemsControl子类,包含选择器的所有公共元素、用于自定义和项目显示的属性集以及数据绑定支持

您只需要学习如何制作listpicker以及如何在其中绑定数据

是开始的最佳链接

添加对microsoft.phone.controls.toolit dll的引用

只需在xaml上查找行
shell:SystemTray.IsVisible=“True”
,然后在上面添加一行

xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
试试这个

 <TextBlock
                x:Name="title"
                Text="School" 
                    Foreground="Black"
                    FontSize="32"
                    VerticalAlignment="Center"

                Margin="5,32,5,23" 
                Tap="title_Tap_1"
                Style="{StaticResource PhoneTextTitle1Style}" Height="52" >

              <toolkit:ContextMenuService.ContextMenu >
                                <toolkit:ContextMenu>
                                    <toolkit:MenuItem Header ="School" Click="MenuItem_School"/>
                                    <toolkit:MenuItem Header ="Class"  Click="MenuItem_Class"/>
                                    <toolkit:MenuItem Header ="Me"     Click="MenuItem_Me"/>
                                </toolkit:ContextMenu>
                            </toolkit:ContextMenuService.ContextMenu>
                    </TextBlock>


我在xaml中尝试了列表选择器。但它正在显示一条错误消息。这对我不起作用。可能是因为我指定我的项目以Windows8为目标。因为它是一个Windows7控件。它显示了错误,但它在我的项目中抛出了错误。可能是因为我默认将其设置为windows 8。这真的没关系,只需与您共享为此编写的代码,以及您遇到的错误就可以了。我在网格中粘贴了Listpicker,但xaml编辑器抱怨没有识别工具包包。它说工具箱前缀未定义再次检查我的帖子我已经编辑并粘贴了代码。感谢您的阅读好的,我假设您的解决方案中引用了toolkit dll(microsoft.phone.controls.toolkit)。您只需要在xaml页面的顶部声明dll。只需检查答案中所做的编辑。