Windows Phone 8中的搜索框 [英] Search box in Windows Phone 8

查看:63
本文介绍了Windows Phone 8中的搜索框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天刚开始使用Windows Phone 8进行编程。

我一直在搜索资源/样本,但我无法执行以下操作:



如何在我的应用程序的UI中插入搜索框



有些文章说我应该在我的XAML中放入SearchBox标签,但它没有得到认可。

我需要做什么? :(



(我知道我需要以某种方式使用Windows.UI.Xaml.Controls命名空间,但我如何在XAML中执行此操作?



当我尝试编译时,我收到以下错误;

SearchBox在名称空间http://schemas.microsoft.com/中不存在client / 2007



Just started programming with Windows phone 8 a litle bit today.
I have been googling for resources/ samples but I am unable to do the following:

How can I insert a search box in the UI of my app

Some articles say I should just put in the SearchBox tag in my XAML, but its not getting recognised.
What do I need to do? :(

(I know i need to somehow use Windows.UI.Xaml.Controls namespace, but how do I do this in XAML?

When I try to compile, I get the following error;
"SearchBox" does not exist in the namespace "http://schemas.microsoft.com/client/2007"

)

推荐答案

你需要添加Microsoft.Phone.Controls.Toolkit nuget包并将以下命名空间添加到您想要搜索框的页面中



you need add Microsoft.Phone.Controls.Toolkit nuget package and add the below namespace to your page where you want search box

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







请找到以下控件粘贴在你的页面并检查








please find the below control paste it in your page and check


<toolkit:PhoneTextBox  Background="Gray" VerticalAlignment="Top" BorderThickness="1" Padding="2" BorderBrush="Red"  x:Name="txtSearchText" TextWrapping="Wrap" Hint="search here" InputScope="Chat"  AcceptsReturn="False" FontSize="21.333" FontFamily="Segoe WP SemiLight"  />







希望这会有所帮助。 />


如果你不工作,请告诉我




hope this helps.

let me know if you it is not working


这篇关于Windows Phone 8中的搜索框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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