Share via


SearchPane.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)]
// 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) 

이벤트 유형

특성

설명

중요

앱에서 Windows 10 이상 검색을 구현하려면 AutoSuggestBox를 사용합니다. 자세한 내용은 자동 제안 상자를 참조하세요.

Windows 10 이상 앱에서 Windows.ApplicationModel.Search API(SearchPane, SearchContract) 또는 SearchBox API를 사용하면 안 됩니다.

참고

앱은 검색 상자(Windows.UI.Xaml.Controls.SearchBox/WinJS.UI.SearchBox)와 SearchPane을 모두 사용할 수 없습니다. 동일한 앱에서 검색 상자와 검색 창을 모두 사용하면 앱에서 "'Windows.UI.Xaml.Controls.SearchBox' 유형의 인스턴스를 만들 수 없습니다."라는 메시지와 함께 예외가 발생합니다.

이 이벤트가 발생할 때 searchPane 에 이벤트 수신기를 추가하고 이벤트에 대한 처리기 함수를 할당하여 알림을 받도록 등록합니다. 이벤트 처리기에 전달되는 searchPaneVisibilityChangedEventArgs 개체를 사용하여 이벤트에 대한 정보에 액세스할 수 있습니다.

적용 대상

추가 정보