SearchSuggestionManager 类

定义

管理对应用内 SearchBox 控件的搜索建议的访问。

public ref class SearchSuggestionManager sealed
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.ApplicationModel.Search.Core.SearchCoreContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.ApplicationModel.Search.Core.SearchCoreContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
class SearchSuggestionManager final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.ApplicationModel.Search.Core.SearchCoreContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.ApplicationModel.Search.Core.SearchCoreContract")]
class SearchSuggestionManager final
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.ApplicationModel.Search.Core.SearchCoreContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.ApplicationModel.Search.Core.SearchCoreContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
public sealed class SearchSuggestionManager
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.ApplicationModel.Search.Core.SearchCoreContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.ApplicationModel.Search.Core.SearchCoreContract")]
public sealed class SearchSuggestionManager
function SearchSuggestionManager()
Public NotInheritable Class SearchSuggestionManager
继承
Object Platform::Object IInspectable SearchSuggestionManager
属性

Windows 要求

设备系列
Windows Desktop Extension SDK (在 10.0.10240.0 中引入)
API contract
Windows.ApplicationModel.Search.Core.SearchCoreContract (在 v1.0 中引入)

构造函数

SearchSuggestionManager()

初始化 SearchSuggestionManager 类的新实例。

属性

SearchHistoryContext

标识搜索的上下文,并用于将用户的搜索历史记录与应用一起存储。

SearchHistoryEnabled

指示是否自动跟踪用户以前对应用的搜索并用于提供建议。

Suggestions

获取当前搜索查询的搜索建议。

方法

AddToHistory(String)

将指定的查询存储在搜索历史记录中。

AddToHistory(String, String)

将指定的查询和输入语言存储在搜索历史记录中。

ClearHistory()

清除当前应用的所有搜索历史记录上下文。

SetLocalContentSuggestionSettings(LocalContentSuggestionSettings)

指定是否将基于本地文件的建议自动添加到 建议 集合,并定义 Windows 用于查找和筛选这些建议的条件。

SetQuery(String)

分配当前搜索查询。

SetQuery(String, String)

使用指定的输入语言分配当前搜索查询。

SetQuery(String, String, SearchQueryLinguisticDetails)

使用指定的输入语言和输入法编辑器 (输入法) 信息分配当前搜索查询。

事件

RequestingFocusOnKeyboardInput

当用户按下启动类型搜索的键时引发。

SuggestionsRequested

当用户的查询文本更改且应用需要提供新建议以在搜索框中显示时引发。

适用于

另请参阅