SearchPane.VisibilityChanged SearchPane.VisibilityChanged SearchPane.VisibilityChanged SearchPane.VisibilityChanged SearchPane.VisibilityChanged Event

Definition

Fires when the user opens or closes the search pane.

public : event TypedEventHandler<SearchPane, SearchPaneVisibilityChangedEventArgs> VisibilityChanged
// Register
event_token VisibilityChanged(TypedEventHandler<SearchPane, SearchPaneVisibilityChangedEventArgs> const& handler) const;

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

// Revoke with event_revoker
VisibilityChanged_revoker VisibilityChanged(auto_revoke_t, TypedEventHandler<SearchPane, SearchPaneVisibilityChangedEventArgs> const& handler) const;
public event TypedEventHandler<SearchPane, SearchPaneVisibilityChangedEventArgs> VisibilityChanged
Public Event VisibilityChanged As TypedEventHandler (Of SearchPane, SearchPaneVisibilityChangedEventArgs)
function onVisibilityChanged(eventArgs){/* Your code */}


searchPane.addEventListener("visibilitychanged", onVisibilityChanged);
searchPane.removeEventListener("visibilitychanged", onVisibilityChanged);

Remarks

Note

An app can't use both the search box (Windows.UI.Xaml.Controls.SearchBox for UWP app using C++, C#, or Visual Basic, WinJS.UI.SearchBox for Windows app using JavaScript) and the SearchPane. Using both the search box and the search pane in the same app causes the app to throw an exception with this message: "Cannot create instance of type 'Windows.UI.Xaml.Controls.SearchBox.'"

Register to be notified when this event fires by adding an event listener to the searchPane and assigning a handler function for the event. You can access information about the event with the searchPaneVisibilityChangedEventArgs object that is passed to your event handler.

See also