Compartilhar via


SearchPane.VisibilityChanged Evento

Definição

Aciona quando o usuário abre ou fecha o painel de 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 VisibilityChanged(TypedEventHandler<SearchPane, SearchPaneVisibilityChangedEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
SearchPane::VisibilityChanged_revoker VisibilityChanged(auto_revoke_t, TypedEventHandler<SearchPane, SearchPaneVisibilityChangedEventArgs 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 VisibilityChanged(TypedEventHandler<SearchPane, SearchPaneVisibilityChangedEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
SearchPane::VisibilityChanged_revoker VisibilityChanged(auto_revoke_t, TypedEventHandler<SearchPane, SearchPaneVisibilityChangedEventArgs 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,SearchPaneVisibilityChangedEventArgs> VisibilityChanged;
[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,SearchPaneVisibilityChangedEventArgs> VisibilityChanged;
function onVisibilityChanged(eventArgs) { /* Your code */ }
searchPane.addEventListener("visibilitychanged", onVisibilityChanged);
searchPane.removeEventListener("visibilitychanged", onVisibilityChanged);
- or -
searchPane.onvisibilitychanged = onVisibilityChanged;
Public Custom Event VisibilityChanged As TypedEventHandler(Of SearchPane, SearchPaneVisibilityChangedEventArgs) 

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

Registre-se para ser notificado quando esse evento for acionado adicionando um ouvinte de eventos ao searchPane e atribuindo uma função de manipulador para o evento. Você pode acessar informações sobre o evento com o objeto searchPaneVisibilityChangedEventArgs que é passado para o manipulador de eventos.

Aplica-se a

Confira também