SearchPane.VisibilityChanged Evento
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Viene generato quando l'utente apre o chiude il riquadro 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 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 evento
- Attributi
Commenti
Importante
Per implementare la ricerca in un'app per Windows 10 o versioni successive, usare AutoSuggestBox. Per altre informazioni, vedere Casella di suggerimento automatico .
Non è consigliabile usare API Windows.ApplicationModel.Search (SearchPane, SearchContract
) o SearchBox nelle app per Windows 10 o versioni successive.
Nota
Un'app non può usare la casella di ricerca (Windows.UI.Xaml.Controls.SearchBoxWinJS.UI.SearchBox/) e SearchPane. Usando sia la casella di ricerca che il riquadro di ricerca nella stessa app, l'app genera un'eccezione con questo messaggio: "Impossibile creare un'istanza di tipo 'Windows.UI.Xaml.Controls.SearchBox'"
Registrare per ricevere una notifica quando questo evento viene generato aggiungendo un listener eventi al searchPane e assegnando una funzione gestore per l'evento. È possibile accedere alle informazioni sull'evento con l'oggetto searchPaneVisibilityChangedEventArgs passato al gestore eventi.