Partilhar via


SearchPane.QuerySubmitted Evento

Definição

Aciona quando o usuário envia o texto na caixa de pesquisa e o aplicativo precisa exibir os resultados da pesquisa.

/// [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 de evento

Atributos

Comentários

Importante

Para implementar a pesquisa em um aplicativo para Windows 10 ou posterior, use AutoSuggestBox. Confira Caixa de sugestão automática para obter mais informações.

Você não deve usar APIs Windows.ApplicationModel.Search (SearchPane, SearchContract) ou APIs SearchBox em aplicativos para Windows 10 ou posterior.

Observação

Um aplicativo não pode usar a caixa de pesquisa (Windows.UI.Xaml.Controls.SearchBox/WinJS.UI.SearchBox) e o SearchPane. Usar a caixa de pesquisa e o painel de pesquisa no mesmo aplicativo faz com que o aplicativo gere uma exceção com esta mensagem: "Não é possível criar uma instância do tipo 'Windows.UI.Xaml.Controls.SearchBox.'"

Se o aplicativo participar do contrato de Pesquisa, registre um manipulador de eventos para responder quando esse evento for acionado. No manipulador de eventos QuerySubmitted, responda levando o usuário à página de resultados da pesquisa e preenchendo-o com os resultados com base em SearchPaneQuerySubmittedEventArgs. QueryText.

Aplica-se a

Confira também