# Overview

This help article covers the specific events exposed by the **RadDocking** control. The events are grouped by their general purpose.

## State Changed Events

* **ActivePaneChanged**: Occurs when the ActivePane is changed. The passed event argument is of type **ActivePangeChangedEventArgs**.

  * **ActivePangeChangedEventArgs**: Exposes information about NewPane (activated) and OldPane (deactivated).
* **PaneStateChange**: This event is fired whenever the state of the RadPane is changed (e.g., pin, unpin, close, show, etc.). The passed event argument is of type **RadRoutedEventArgs**. The modified **RadPane** element can be accessed via the **OriginalSource** property of the event arguments.

#### **Pin\Unpin Events**

* **PreviewUnpin**: Occurs before the RadPane is unpinned. The passed event argument is of type **StateChangeEventArgs**.

* **Unpin**: Occurs when the RadPane is unpinned. The passed event argument is of type **StateChangeEventArgs**.

* **PreviewPin**: Occurs before the RadPane is pinned. The passed event argument is of type **StateChangeEventArgs**.

* **Pin**: Occurs when the RadPane is pinned. The passed event argument is of type **StateChangeEventArgs**.

> For example, when you [unpin](https://www.telerik.com/products/wpf/documentation/controls/raddocking/features/panes/pinned-unpinned-panes) a RadPane, the events fire in this order:
>
> * **PreviewUnpin**
> * **Unpin**
> * **PaneStateChange**

## Show\Hide Events

* **PreviewShow**: Occurs before the RadPane is shown. The passed event argument is of type **StateChangeEventArgs**.

* **Show**: Occurs when the RadPane is shown. The passed event argument is of type **StateChangeEventArgs**.

* **PreviewClose**: Occurs before the RadPane is closed. The passed event argument is of type **StateChangeEventArgs**.

* **Close**: Occurs when the RadPane is closed. The passed event argument is of type **StateChangeEventArgs**.

> tip **PreviewClose** and **Close** events are fired whenever you press the [Close](https://www.telerik.com/products/wpf/documentation/controls/raddocking/general-information/visual-structure) button.

> tip **PreviewShow** and **Show** events are fired when you invoke the **ShowAllPanes** method of the **RadPaneGroup** class. This method will show all hidden panes.

> When you close a floatable window, the "close" events fired in this order:
>
> * **PreviewWindowClose**
> * **PreviewClose**
> * **WindowClose**
> * **Close**

## Compass Events

* **PreviewShowCompass**: Occurs when the [Compass](https://www.telerik.com/products/wpf/documentation/controls/raddocking/features/compass) is shown.

## Save\Load Layout Events

* **ElementLoading**: Raised when a docking element (**Pane**, **PaneGroup** or **SplitContainer**) is about to be loaded. The passed event argument is of type **LayoutSerializationLoadingEventArgs**. Element loading can be canceled by setting the **Cancel** property from the event arguments.

* **ElementLoaded**: Raised after a docking element (**Pane**, **PaneGroup** or **SplitContainer**) is loaded. The passed event argument is of type **LayoutSerializationEventArgs**.

* **ElementLayoutSaving** (introduced with R2 2016 of UI for WPF) - Raised when a docking element (**Pane**, **PaneGroup** or **SplitContainer**) starts saving. The passed event argument is of type **LayoutSerializationSavingEventArgs**. Element layout saving can be canceled by setting the **Cancel** property from the event arguments.

* **ElementSaved**: Raised after a docking element (**Pane**, **PaneGroup** or **SplitContainer**) is saved. The passed event argument is of type **LayoutSerializationEventArgs**.

* **ElementLayoutCleaning** (introduced with R2 2016 of UI for WPF) - Raised when a docking element (**Pane**, **PaneGroup** or **SplitContainer**) starts cleaning up. The passed event argument is of type **LayoutSerializationCleaningEventArgs**. Element layout cleaning can be canceled by setting the **Cancel** property from the event arguments.

* **ElementCleaned**: Raised after a docking element (**Pane**, **PaneGroup** or **SplitContainer**) is cleaned. The passed event argument is of type **LayoutSerializationEventArgs**.

* **CustomElementLoading**: Raised when a custom docking element (that derives from **RadPane**, **RadPaneGroup** or **RadSplitContainer**) is about to be loaded. The passed event argument is of type **LayoutSerializationCustomLoadingEventArgs**.

> tip Elements are **cleaned just before loading** the layout: This operation is performed to prepare the Docking control for the new layout.

> tip For more information about saving and loading **RadDocking** layout, take a look at the [Save\Load Layout](https://www.telerik.com/products/wpf/documentation/controls/raddocking/features/save-load-layout/overview) topic.

## ElementCreated Events

* **ToolWindowCreated**: Raised when a ToolWindow instance is internally auto-generated by RadDocking.

* **PaneGroupCreated**: Raised when a PaneGroup instance is internally auto-generated by RadDocking.

* **SplitContainerCreated**: Raised when a SplitContainer instance is internally auto-generated by RadDocking.

Using the ElementCreatedEventArgs provided by each of the above events, the user could get information about the root UIElement that raises the event and the newly generated element - ToolWindow, PaneGroup or SplitContainer.

> The **ElementCreated** events are expected to be raised only when the PaneGroup, SplitContainer or ToolWindow are automatically and internally generated by RadDocking, not by the user. The events are not raised when **RadDocking** is initially loading.

## Other Events

* **Loaded**: Occurs when the **RadDocking** has been constructed and added to the object tree.
* **LayoutUpdated**: Occurs when the layout of the visual tree changes.

## See Also

* [RadPane](https://www.telerik.com/products/wpf/documentation/controls/raddocking/features/panes/radpane)
* [RadDocumentPane](https://www.telerik.com/products/wpf/documentation/controls/raddocking/features/panes/raddocumentpane)
* [Docked/Floating Panes](https://www.telerik.com/products/wpf/documentation/controls/raddocking/features/panes/docked-floating-panes)
* [Pinned/Unpinned Panes](https://www.telerik.com/products/wpf/documentation/controls/raddocking/features/panes/pinned-unpinned-panes)
