SearchPane.SetLocalContentSuggestionSettings 方法

定义

指定基于本地文件的建议是否自动显示在搜索窗格中,并定义 Windows 用于查找和筛选这些建议的条件。

public:
 virtual void SetLocalContentSuggestionSettings(LocalContentSuggestionSettings ^ settings) = SetLocalContentSuggestionSettings;
/// [Windows.Foundation.Metadata.Deprecated("ISearchPane may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.ApplicationModel.Search.SearchContract)]
void SetLocalContentSuggestionSettings(LocalContentSuggestionSettings const& settings);
/// [Windows.Foundation.Metadata.Deprecated("ISearchPane may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.ApplicationModel.Search.SearchContract")]
void SetLocalContentSuggestionSettings(LocalContentSuggestionSettings const& settings);
[Windows.Foundation.Metadata.Deprecated("ISearchPane may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.ApplicationModel.Search.SearchContract))]
public void SetLocalContentSuggestionSettings(LocalContentSuggestionSettings settings);
[Windows.Foundation.Metadata.Deprecated("ISearchPane may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.ApplicationModel.Search.SearchContract")]
public void SetLocalContentSuggestionSettings(LocalContentSuggestionSettings settings);
function setLocalContentSuggestionSettings(settings)
Public Sub SetLocalContentSuggestionSettings (settings As LocalContentSuggestionSettings)

参数

settings
LocalContentSuggestionSettings

本地内容建议的新设置。

属性

注解

重要

若要在应用中实现Windows 10或更高版本的搜索,请使用 AutoSuggestBox。 有关详细信息 ,请参阅自动建议框

不应在 Windows 10 或更高版本的应用中使用 Windows.ApplicationModel.Search API (SearchPaneSearchContract) 或 SearchBox API。

注意

应用不能同时使用搜索框 (Windows.UI.Xaml.Controls.SearchBox/WinJS.UI.SearchBox) 和 SearchPane。 在同一应用中同时使用搜索框和搜索窗格会导致应用引发异常,并显示以下消息:“无法创建'Windows.UI.Xaml.Controls.SearchBox'类型的实例。”

启用本地内容建议后,当用户输入查询文本时,Windows 将提供用户本地文件中的搜索建议。 例如,图片应用程序可以配置本地内容建议,以便搜索建议仅来自存储在用户图片库中的特定类型的图像文件。

适用于

另请参阅