Provides information about the activated event that fires when the user searches the app from the Search charm and the app isn't the main app on screen.
C#/C++/VB: This type appears as SearchActivatedEventArgs.
Syntax
/* For information about creating or accessing this object, see Remarks. */
Attributes
- MarshalingBehaviorAttribute(Standard)
- VersionAttribute(NTDDI_WIN8)
Members
The WebUISearchActivatedEventArgs class has these types of members:
Methods
The WebUISearchActivatedEventArgs class inherits methods from the Object class (C#/VB/C++).
Properties
The WebUISearchActivatedEventArgs class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets the app activated operation. | |
| Read-only | Gets the activation type. | |
| Read-only | Gets the Internet Engineering Task Force (IETF) language tag (BCP 47 standard) that identifies the language currently associated with the user's text input device. | |
| Read-only | Gets the execution state of the app before it was activated. | |
| Read-only | Gets the text that the user wants the app to search for. | |
| Read-only | Gets the splash screen object that provides information about the transition from the splash screen to the activated app. |
Remarks
If your app integrates with the Search contract, a webUISearchActivatedEventArgs is passed to your app's onactivated event handler when the user searches the app from the Search charm and your app is not the main app on screen. This type of activation is indicated by the activationKind.search value returned by the kind property.
Learn how to let users search with your app in Quickstart: Adding search. Learn about responding to other search-related events and customizing the search box and suggestions using the searchPane class in the Windows.ApplicationModel.Search namespace reference.
Note : This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX).
Examples
The Search contract sample demonstrates how to respond to a search activated event.
function activated(eventObject) { if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) { // Use setPromise to indicate to the system that the splash screen must not be torn down // until after processAll and navigate complete asynchronously. eventObject.setPromise(WinJS.UI.processAll().then(function () { // Navigate to either the first scenario or to the last running scenario // before suspension or termination. var url = WinJS.Application.sessionState.lastUrl || scenarios[0].url; return WinJS.Navigation.navigate(url); })); } else if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.search) { // Use setPromise to indicate to the system that the splash screen must not be torn down // until after processAll and navigate complete asynchronously. eventObject.setPromise(WinJS.UI.processAll().then(function () { if (eventObject.detail.queryText === "") { // Navigate to your landing page since the user is pre-scoping to your app. } else { // Display results in UI for eventObject.detail.queryText and eventObject.detail.language. // eventObject.detail.language represents user's locale. } // Navigate to the first scenario since it handles search activation. var url = scenarios[0].url; return WinJS.Navigation.navigate(url, { searchDetails: eventObject.detail }); })); } }
For JavaScript, eventObject contains a webUISearchActivatedEventArgs object.
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
|
Namespace |
Windows.UI.WebUI |
|
Metadata |
|
See also
Build date: 12/4/2012