Imports Infragistics.Windows.DockManager
Imports Infragistics.Windows.DockManager.Events
Private Sub ContentPane_Closing(ByVal sender As Object, ByVal e As PaneClosingEventArgs)
Dim result As MessageBoxResult = MessageBox.Show(Me, "Can this pane be hidden?", "Close Pane", MessageBoxButton.YesNo, MessageBoxImage.Question)
If MessageBoxResult.No = result Then
e.Cancel = True
End If
End Sub
Private Sub ContentPane_Closed(ByVal sender As Object, ByVal e As PaneClosedEventArgs)
Dim cp As ContentPane = TryCast(e.OriginalSource, ContentPane)
System.Diagnostics.Debug.WriteLine(cp.Header, "Closed")
End Sub
Private Sub InitializeDmClosePane(ByVal dockManager As XamDockManager)
Dim split As New SplitPane()
' By default when a pane is closed, it
' is just hidden. For some panes though
' you may just want the pane to be removed.
' The CloseAction can be used to control this.
Dim cpRemove As New ContentPane()
cpRemove.CloseAction = PaneCloseAction.RemovePane
cpRemove.Header = "Remove When Closed"
split.Panes.Add(cpRemove)
' You can prevent a pane from being closed using
' the AllowClose property. By default all panes
' can be closed and when closed the Visibility
' is changed to Collapsed.
Dim cpNever As New ContentPane()
cpNever.AllowClose = False
cpNever.Header = "Never Close"
split.Panes.Add(cpNever)
' You can handle the Closing event to conditionally
' prevent the pane from being closed. The Closed
' event is fired after the pane has been closed
' regardless of the CloseAction
Dim cpConditional As New ContentPane()
cpConditional.Header = "Conditionally Close"
AddHandler cpConditional.Closing, AddressOf Me.ContentPane_Closing
AddHandler cpConditional.Closed, AddressOf Me.ContentPane_Closed
split.Panes.Add(cpConditional)
dockManager.Panes.Add(split)
End Sub