共用方式為


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。 如需詳細資訊,請參閱 自動建議方塊

您不應該在 app 中使用Windows.ApplicationModel.Search API (SearchPaneSearchContract) 或SearchBox API,以進行Windows 10或更新版本。

注意

應用程式無法使用搜尋方塊 (Windows.UI.Xaml.Controls.SearchBoxWinJS.UI.SearchBox/) 和 SearchPane。 在相同的應用程式中同時使用搜尋方塊和搜尋窗格,會導致應用程式擲回例外狀況,並顯示下列訊息:「無法建立類型為 'Windows.UI.Xaml.Controls.SearchBox'的實例。」

啟用本機內容建議時,Windows 會在使用者輸入查詢文字時,從使用者的本機檔案提供搜尋建議。 例如,圖片應用程式可以設定本機內容建議,讓搜尋建議只來自儲存在使用者圖片庫中的特定影像檔。

適用於

另請參閱