WebUISearchActivatedEventArgs WebUISearchActivatedEventArgs WebUISearchActivatedEventArgs WebUISearchActivatedEventArgs WebUISearchActivatedEventArgs Class

Definition

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.

public : sealed class WebUISearchActivatedEventArgs : IActivatedEventArgs, IApplicationViewActivatedEventArgs, ISearchActivatedEventArgs, ISearchActivatedEventArgsWithLinguisticDetails, IActivatedEventArgsDeferral
struct winrt::Windows::UI::WebUI::WebUISearchActivatedEventArgs : IActivatedEventArgs, IApplicationViewActivatedEventArgs, ISearchActivatedEventArgs, ISearchActivatedEventArgsWithLinguisticDetails, IActivatedEventArgsDeferral
public sealed class WebUISearchActivatedEventArgs : IActivatedEventArgs, IApplicationViewActivatedEventArgs, ISearchActivatedEventArgs, ISearchActivatedEventArgsWithLinguisticDetails, IActivatedEventArgsDeferral
Public NotInheritable Class WebUISearchActivatedEventArgs Implements IActivatedEventArgs, IApplicationViewActivatedEventArgs, ISearchActivatedEventArgs, ISearchActivatedEventArgsWithLinguisticDetails, IActivatedEventArgsDeferral
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows Desktop Extension SDK (introduced v10.0.10240.0) Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.ApplicationModel.Activation.WebUISearchActivatedEventsContract (introduced v1)

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.

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)

.

Properties

ActivatedOperation ActivatedOperation ActivatedOperation ActivatedOperation ActivatedOperation

Gets the app activated operation.

CurrentlyShownApplicationViewId CurrentlyShownApplicationViewId CurrentlyShownApplicationViewId CurrentlyShownApplicationViewId CurrentlyShownApplicationViewId

Gets the identifier for the currently shown app view.

Kind Kind Kind Kind Kind

Gets the activation type.

Language Language Language Language Language

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.

LinguisticDetails LinguisticDetails LinguisticDetails LinguisticDetails LinguisticDetails

Gets a SearchPaneQueryLinguisticDetails object that provides info about query text that the user enters through an Input Method Editor (IME).

PreviousExecutionState PreviousExecutionState PreviousExecutionState PreviousExecutionState PreviousExecutionState

Gets the execution state of the app before it was activated.

QueryText QueryText QueryText QueryText QueryText

Gets the text that the user wants the app to search for. The user entered this text into the search box of the search pane.

SplashScreen SplashScreen SplashScreen SplashScreen SplashScreen

Gets the splash screen object that provides information about the transition from the splash screen to the activated app.

See Also