'宣言 Public Event NavigationPaneFlyoutClosed As NavigationPaneFlyoutClosedEventHandler
public event NavigationPaneFlyoutClosedEventHandler NavigationPaneFlyoutClosed
イベント ハンドラが、このイベントに関連するデータを含む、NavigationPaneFlyoutClosedEventArgs 型の引数を受け取りました。次の NavigationPaneFlyoutClosedEventArgs プロパティには、このイベントの固有の情報が記載されます。
プロパティ | 解説 |
---|---|
Canceled | フライアウト セッションがキャンセルされたかどうかを返します。たとえば、ユーザーが Escape キーを押してフライアウトを閉じたかどうかです。 |
SelectedItem | フライアウト セッション中にエンドユーザーによって選択された UltraExplorerBarItem を返します。またはフライアウト セッションがキャンセルされた場合は null を返します。 |
末端の開発者は、CloseNavigationPaneFlyout メソッドを呼び出すことによって、プログラムを使用してナビゲーション ペイン フライアウトを閉じることができます。フライアウトがこのように閉じられる、またはユーザーの操作を介して閉じられるかにかかわらず、NavigationPaneFlyoutClosed イベントは発生します。ナビゲーション ペイン フライアウトが閉じないようにすることはできないため、閉じる前にキャンセル可能なイベントがまったく発生しないことに注意してください。
Imports Infragistics.Win Imports Infragistics.Win.UltraWinExplorerBar ' Handles the Form's 'Load' event Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' Hook the NavigationPaneCollapsed event AddHandler Me.ultraExplorerBar1.NavigationPaneFlyoutDisplayed, AddressOf Me.ultraExplorerBar1_NavigationPaneFlyoutDisplayed End Sub ' Handles the ExplorerBar's 'NavigationPaneFlyoutDisplayed' event Private Sub ultraExplorerBar1_NavigationPaneFlyoutDisplayed(ByVal sender As Object, ByVal e As EventArgs) Dim explorerBar As UltraExplorerBar = sender ' Deregister from the notification list since we won't need this ' until after the NavigationPaneFlyoutClosed event is fired RemoveHandler explorerBar.NavigationPaneFlyoutDisplayed, AddressOf Me.ultraExplorerBar1_NavigationPaneFlyoutDisplayed ' Register as a listener for the NavigationPaneFlyoutClosed event AddHandler explorerBar.NavigationPaneFlyoutClosed, AddressOf Me.ultraExplorerBar1_NavigationPaneFlyoutClosed End Sub ' Handles the ExplorerBar's 'NavigationPaneFlyoutDisplayed' event Private Sub ultraExplorerBar1_NavigationPaneFlyoutClosed(ByVal sender As Object, ByVal e As NavigationPaneFlyoutClosedEventArgs) Dim explorerBar As UltraExplorerBar = sender ' Deregister from the notification list since we won't need this ' until after the NavigationPaneFlyoutDisplayed event is fired RemoveHandler explorerBar.NavigationPaneFlyoutClosed, AddressOf Me.ultraExplorerBar1_NavigationPaneFlyoutClosed ' Register as a listener for the NavigationPaneFlyoutDisplayed event AddHandler explorerBar.NavigationPaneFlyoutDisplayed, AddressOf Me.ultraExplorerBar1_NavigationPaneFlyoutDisplayed If (e.Canceled = False AndAlso Not e.SelectedItem Is Nothing) Then Debug.WriteLine(String.Format("Item '{0}' selected.", e.SelectedItem.Text)) End If End Sub
using Infragistics.Win; using Infragistics.Win.UltraWinExplorerBar; using System.Diagnostics; // Handles the Form's 'Load' event. private void Form1_Load(object sender, System.EventArgs e) { // Hook the NavigationPaneFlyoutDisplayed event this.ultraExplorerBar1.NavigationPaneFlyoutDisplayed += new EventHandler( this.ultraExplorerBar1_NavigationPaneFlyoutDisplayed ); } // Handles the ExplorerBar's 'NavigationPaneExpanded' event. private void ultraExplorerBar1_NavigationPaneFlyoutDisplayed( object sender, EventArgs e ) { UltraExplorerBar explorerBar = sender as UltraExplorerBar; // Deregister from the notification list since we won't need this // until after the NavigationPaneFlyoutClosed event is fired explorerBar.NavigationPaneFlyoutDisplayed -= new EventHandler( this.ultraExplorerBar1_NavigationPaneFlyoutDisplayed ); // Register as a listener for the NavigationPaneFlyoutClosed event explorerBar.NavigationPaneFlyoutClosed += new NavigationPaneFlyoutClosedEventHandler( this.ultraExplorerBar1_NavigationPaneFlyoutClosed ); } // Handles the ExplorerBar's 'NavigationPaneFlyoutClosed' event. private void ultraExplorerBar1_NavigationPaneFlyoutClosed( object sender, NavigationPaneFlyoutClosedEventArgs e ) { UltraExplorerBar explorerBar = sender as UltraExplorerBar; // Deregister from the notification list since we won't need this // until after the NavigationPaneFlyoutDisplayed event is fired explorerBar.NavigationPaneFlyoutClosed -= new NavigationPaneFlyoutClosedEventHandler( this.ultraExplorerBar1_NavigationPaneFlyoutClosed ); // Register as a listener for the NavigationPaneFlyoutDisplayed event explorerBar.NavigationPaneFlyoutDisplayed += new EventHandler( this.ultraExplorerBar1_NavigationPaneFlyoutDisplayed ); if ( e.Canceled == false && e.SelectedItem != null ) { Debug.WriteLine( string.Format( "Item '{0}' selected.", e.SelectedItem.Text ) ); } }