Windows.ApplicationModel.Search.SearchPane

March 3, 2023 ยท View on GitHub

-description

Deprecated. Use the Windows.UI.Xaml.Controls.AutoSuggestBox control instead. Represents and manages the search pane that opens when a user activates the Search charm.

-remarks

Important

To implement search in an app for Windows 10 or later, use AutoSuggestBox. See Auto-suggest box for more info.

You should not use Windows.ApplicationModel.Search APIs (SearchPane, SearchContract) or SearchBox APIs in apps for Windows 10 or later.

Note

An app can't use both the search box (Windows.UI.Xaml.Controls.SearchBox/WinJS.UI.SearchBox) and the SearchPane. Using both the search box and the search pane in the same app causes the app to throw an exception with this message: "Cannot create instance of type 'Windows.UI.Xaml.Controls.SearchBox.'"

This object is available to apps that participate in the Search contract. In order to provide users with search results, you must add code to your Activated event handler that responds when your app is activated for search. To learn more about responding to Search activation events, see webUISearchActivatedEventArgs (JavaScript) or SearchActivatedEventArgs (C#/C++/VB).

You can see code examples that demonstrate how to respond to search events and manage the search pane in the Search contract sample (Windows 8).

-examples

-see-also

Search contract sample (Windows 8), Handle app activation, SearchPane.GetForCurrentView method, Windows.ApplicationModel.Activation.ActivationKind enum, Windows.ApplicationModel.Activation.SearchActivatedEventArgs class, Windows.ApplicationModel.Core.CoreApplicationView.Activated event