Version

Closed Event

Occurs when the ContentPane has been closed
Syntax
'Declaration
 
Public Event Closed As EventHandler(Of PaneClosedEventArgs)
public event EventHandler<PaneClosedEventArgs> Closed
Event Data

The event handler receives an argument of type PaneClosedEventArgs containing data related to this event. The following PaneClosedEventArgs properties provide information specific to this event.

PropertyDescription
Handled (Inherited from System.Windows.RoutedEventArgs)Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.
OriginalSource (Inherited from System.Windows.RoutedEventArgs)Gets the original reporting source as determined by pure hit testing, before any possible System.Windows.RoutedEventArgs.Source adjustment by a parent class.
RoutedEvent (Inherited from System.Windows.RoutedEventArgs)Gets or sets the System.Windows.RoutedEventArgs.RoutedEvent associated with this System.Windows.RoutedEventArgs instance.
Source (Inherited from System.Windows.RoutedEventArgs)Gets or sets a reference to the object that raised the event.
Example
This example demonstrates using some of the close/hide related members of the ContentPane class.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

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
using Infragistics.Windows.DockManager;
using Infragistics.Windows.DockManager.Events;

private void ContentPane_Closing(object sender, PaneClosingEventArgs e)
{
	MessageBoxResult result = MessageBox.Show(this, "Can this pane be hidden?", 
		"Close Pane", MessageBoxButton.YesNo, MessageBoxImage.Question);

	if (MessageBoxResult.No == result)
	{
		e.Cancel = true;
	}
}

private void ContentPane_Closed(object sender, PaneClosedEventArgs e)
{
	ContentPane cp = e.OriginalSource as ContentPane;

	System.Diagnostics.Debug.WriteLine(cp.Header, "Closed");
} 

private void InitializeDmClosePane(XamDockManager dockManager)
{
	SplitPane split = 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.
	ContentPane cpRemove = 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.
	ContentPane cpNever = 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
	ContentPane cpConditional = new ContentPane();
	cpConditional.Header = "Conditionally Close";
	cpConditional.Closing += new EventHandler<PaneClosingEventArgs>(this.ContentPane_Closing);
	cpConditional.Closed += new EventHandler<PaneClosedEventArgs>(this.ContentPane_Closed);
	split.Panes.Add(cpConditional);

	dockManager.Panes.Add(split);
}
<igDock:XamDockManager>
    
<igDock:XamDockManager.Panes>
        
<igDock: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.
            
-->
            
<igDock:ContentPane Header="Remove When Closed"
                                
CloseAction="RemovePane"/>

            
<!-- 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. 
-->
            
<igDock:ContentPane Header="Never Close"
                                
AllowClose="False"/>
            
            
<!-- 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. 
-->
            
<igDock:ContentPane Header="Conditionally Close"
                                
Closing="ContentPane_Closing"
                                
Closed="ContentPane_Closed"/>
        
</igDock:SplitPane>
    
</igDock:XamDockManager.Panes>
</igDock:XamDockManager>
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also