SearchPane.QueryChanged Event

Definition

Fires when the user changes the text in the search box.

// Register
event_token QueryChanged(TypedEventHandler<SearchPane, SearchPaneQueryChangedEventArgs const &> const& handler) const;

// Revoke with event_token
void QueryChanged(event_token const* cookie) const;

// Revoke with event_revoker
QueryChanged_revoker QueryChanged(auto_revoke_t, TypedEventHandler<SearchPane, SearchPaneQueryChangedEventArgs const &> const& handler) const;
[add: 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))]
[remove: 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 event TypedEventHandler<SearchPane,SearchPaneQueryChangedEventArgs> QueryChanged;
[add: 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")]
[remove: 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 event TypedEventHandler<SearchPane,SearchPaneQueryChangedEventArgs> QueryChanged;
function onQueryChanged(eventArgs) { /* Your code */ }
searchPane.addEventListener("querychanged", onQueryChanged);
searchPane.removeEventListener("querychanged", onQueryChanged);
- or -
searchPane.onquerychanged = onQueryChanged;
Public Custom Event QueryChanged As TypedEventHandler(Of SearchPane, SearchPaneQueryChangedEventArgs) 
Attributes

Remarks

Note

An app can't use both the search box (Windows.UI.Xaml.Controls.SearchBox for UWP app using C++, C#, or Visual Basic, WinJS.UI.SearchBox for Windows app using JavaScript) 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.'"

Register to be notified when this event fires by adding an event listener to the searchPane and assigning a handler function for the event. You can access information about the event with the searchPaneQueryChangedEventArgs object that is passed to your event handler.

Applies to

See also