[英]Where is Windows.UI.Xaml.Controls.SearchBox?
I can't add using Windows.UI.Xaml.Controls.SearchBox;
我无法using Windows.UI.Xaml.Controls.SearchBox;
添加using Windows.UI.Xaml.Controls.SearchBox;
to my Windows Store Application. 到我的Windows应用商店应用程序。 Visual Studio doesn't seem to know what I'm talking about. Visual Studio似乎不知道我在说什么。 It tells me that it doesn't exist in the namespace. 它告诉我它在名称空间中不存在。
A namespace is a collection of classes, to use one of the classes you need to reference the respective namespace. 名称空间是类的集合,要使用其中一个类,您需要引用相应的名称空间。
Windows.UI.Xaml.Controls
is namespace Windows.UI.Xaml.Controls
是名称空间
SearchBox
is a class SearchBox
是一个类
You need to add reference of Windows.UI.Xaml.Controls
: 您需要添加Windows.UI.Xaml.Controls
引用:
using Windows.UI.Xaml.Controls;
and create an object of Windows.UI.Xaml.Controls.SearchBox
: 并创建Windows.UI.Xaml.Controls.SearchBox
对象:
Windows.UI.Xaml.Controls.SearchBox sbox = new Windows.UI.Xaml.Controls.SearchBox();
this.Controls.Add(sbox); //this line will add it to your app page controls list
Here is the list of controls available in Windows.UI.Xaml.Controls
namespace. 这是Windows.UI.Xaml.Controls
命名空间中可用的控件列表。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.