共用方式為


NavigationView.PaneClosing 事件

定義

當 NavigationView 窗格關閉時發生。

適用于 UWP 的對等 WinUI 2 APIMicrosoft.UI.Xaml.Controls.NavigationView.PaneClosing (Windows 應用程式 SDK 中的 WinUI,請參閱Windows 應用程式 SDK命名空間) 。

// Register
event_token PaneClosing(TypedEventHandler<NavigationView, NavigationViewPaneClosingEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
NavigationView::PaneClosing_revoker PaneClosing(auto_revoke_t, TypedEventHandler<NavigationView, NavigationViewPaneClosingEventArgs const&> const& handler) const;
public event TypedEventHandler<NavigationView,NavigationViewPaneClosingEventArgs> PaneClosing;
function onPaneClosing(eventArgs) { /* Your code */ }
navigationView.addEventListener("paneclosing", onPaneClosing);
navigationView.removeEventListener("paneclosing", onPaneClosing);
- or -
navigationView.onpaneclosing = onPaneClosing;
Public Custom Event PaneClosing As TypedEventHandler(Of NavigationView, NavigationViewPaneClosingEventArgs) 
<NavigationView PaneClosing="eventhandler" />

事件類型

Windows 需求

裝置系列
Windows 10, version 1803 (已於 10.0.17134.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v6.0 引進)

適用於