SearchActivatedEventArgs 類別

定義

提供使用者從 [搜尋] 常用鍵搜尋應用程式時所引發之啟動事件的相關資訊,而應用程式不是螢幕上的主要應用程式。

JAVAscript 此類型會顯示為 webUISearchActivatedEventArgs

public ref class SearchActivatedEventArgs sealed : IApplicationViewActivatedEventArgs, ISearchActivatedEventArgs, ISearchActivatedEventArgsWithLinguisticDetails, IViewSwitcherProvider
public ref class SearchActivatedEventArgs sealed : IActivatedEventArgsWithUser, IApplicationViewActivatedEventArgs, ISearchActivatedEventArgs, ISearchActivatedEventArgsWithLinguisticDetails, IViewSwitcherProvider
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class SearchActivatedEventArgs final : IApplicationViewActivatedEventArgs, ISearchActivatedEventArgs, ISearchActivatedEventArgsWithLinguisticDetails, IViewSwitcherProvider
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class SearchActivatedEventArgs final : IActivatedEventArgsWithUser, IApplicationViewActivatedEventArgs, ISearchActivatedEventArgs, ISearchActivatedEventArgsWithLinguisticDetails, IViewSwitcherProvider
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class SearchActivatedEventArgs : IApplicationViewActivatedEventArgs, ISearchActivatedEventArgs, ISearchActivatedEventArgsWithLinguisticDetails, IViewSwitcherProvider
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class SearchActivatedEventArgs : IActivatedEventArgsWithUser, IApplicationViewActivatedEventArgs, ISearchActivatedEventArgs, ISearchActivatedEventArgsWithLinguisticDetails, IViewSwitcherProvider
Public NotInheritable Class SearchActivatedEventArgs
Implements IApplicationViewActivatedEventArgs, ISearchActivatedEventArgs, ISearchActivatedEventArgsWithLinguisticDetails, IViewSwitcherProvider
Public NotInheritable Class SearchActivatedEventArgs
Implements IActivatedEventArgsWithUser, IApplicationViewActivatedEventArgs, ISearchActivatedEventArgs, ISearchActivatedEventArgsWithLinguisticDetails, IViewSwitcherProvider
繼承
Object Platform::Object IInspectable SearchActivatedEventArgs
屬性
實作

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

備註

重要

若要在應用程式中實作Windows 10或更新版本的搜尋,請使用AutoSuggestBox。 如需詳細資訊,請參閱 自動建議方塊

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

如果您的應用程式與搜尋合約整合,當使用者從搜尋常用鍵搜尋應用程式,且您的應用程式不是螢幕上的主要應用程式時,SearchActivatedEventArgs 物件會傳遞至應用程式的 OnSearchActivated 啟用點處理常式。 這種類型的啟用是由Kind屬性傳回的ActivationKind.Search值所表示。

啟用案例中涉及的所有 應用程式 覆寫都應該在其實作中呼叫 Window.Activate

版本歷程記錄

Windows 版本 SDK 版本 已新增值
1607 14393 User

屬性

CurrentlyShownApplicationViewId

取得目前顯示之應用程式檢視的識別碼。

Kind

取得啟用類型。

Language

取得網際網路工程工作組 (IETF) 語言標籤, (BCP 47 標準) ,識別目前與使用者文字輸入裝置相關聯的語言。

LinguisticDetails

取得 SearchPaneQueryLinguisticDetails 物件,提供使用者透過輸入法編輯器輸入之查詢文字的相關資訊, (輸入法) 。

PreviousExecutionState

取得應用程式啟動前的執行狀態。

QueryText

取得使用者想要應用程式搜尋的文字。 使用者在搜尋窗格的搜尋方塊中輸入此文字。

SplashScreen

取得 SplashScreen 物件,提供從啟動顯示畫面轉換至啟動應用程式的相關資訊。

User

取得啟動應用程式的使用者。

ViewSwitcher

取得檢視切換器物件,可讓您設定應用程式的檢視。

適用於

另請參閱