Condividi tramite


SearchPane.QuerySubmitted Evento

Definizione

Viene generato quando l'utente invia il testo nella casella di ricerca e l'app deve visualizzare i risultati della 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 QuerySubmitted(TypedEventHandler<SearchPane, SearchPaneQuerySubmittedEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
SearchPane::QuerySubmitted_revoker QuerySubmitted(auto_revoke_t, TypedEventHandler<SearchPane, SearchPaneQuerySubmittedEventArgs 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 QuerySubmitted(TypedEventHandler<SearchPane, SearchPaneQuerySubmittedEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
SearchPane::QuerySubmitted_revoker QuerySubmitted(auto_revoke_t, TypedEventHandler<SearchPane, SearchPaneQuerySubmittedEventArgs 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,SearchPaneQuerySubmittedEventArgs> QuerySubmitted;
[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,SearchPaneQuerySubmittedEventArgs> QuerySubmitted;
function onQuerySubmitted(eventArgs) { /* Your code */ }
searchPane.addEventListener("querysubmitted", onQuerySubmitted);
searchPane.removeEventListener("querysubmitted", onQuerySubmitted);
- or -
searchPane.onquerysubmitted = onQuerySubmitted;
Public Custom Event QuerySubmitted As TypedEventHandler(Of SearchPane, SearchPaneQuerySubmittedEventArgs) 

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'".

Se l'app partecipa al contratto di ricerca, registrare un gestore eventi per rispondere quando viene generato questo evento. Nel gestore dell'evento QuerySubmitted rispondere portando l'utente alla pagina dei risultati della ricerca e popolandolo con i risultati in base a SearchPaneQuerySubmittedEventArgs. QueryText.

Si applica a

Vedi anche