Condividi tramite


SearchPane.QueryChanged Evento

Definizione

Viene generato quando l'utente modifica il testo nella casella di ricerca.

/// [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)]
// 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
SearchPane::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, "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")]
// 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
SearchPane::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) 

Tipo evento

Attributi

Commenti

Importante

Per implementare la ricerca in un'app per Windows 10 o versione successiva, usare AutoSuggestBox. Per altre informazioni, vedi Casella di suggerimento automatico .

Non è consigliabile usare le API Windows.ApplicationModel.Search (SearchPane, SearchContract) o SearchBox nelle app per Windows 10 o versioni successive.

Nota

Un'app non può usare sia la casella di ricerca (Windows.UI.Xaml.Controls.SearchBox/WinJS.UI.SearchBox) che searchPane. L'uso della casella di ricerca e del riquadro di ricerca nella stessa app fa sì che l'app generi un'eccezione con questo messaggio: "Impossibile creare un'istanza di tipo 'Windows.UI.Xaml.Controls.SearchBox'".

Registra per ricevere una notifica quando questo evento viene generato aggiungendo un listener di eventi al searchPane e assegnando una funzione del gestore per l'evento. È possibile accedere alle informazioni sull'evento con l'oggetto searchPaneQueryChangedEventArgs passato al gestore eventi.

Si applica a

Vedi anche