Tracking the ActiveWindow
In certain scenarios you may need to track the moment the ActiveWindow of RadDock is being changed. For this purpose RadDock exposes two events:
-
ActiveWindowChanging: This event is fired when the active window is about to be changed, but it is still not changed. This allows you to cancel the active window changing operation. Depending on the scenario, you may need to understand which the currently active window is and which is the window that is about to become active. For this purpose, the event arguments of
ActiveWindowChanging
expose two useful properties:NewWindow: returns the dock window that is about to become active.
-
OldWindow: returns the currently active window.
In the picture below the currently active window is
toolWindow2
. ActivatingtoolWindow1
will causeActiveWindowChanging
to fire, and we can expect NewWindow to returntoolWindow1
and OldWindow to returntoolWindow2
.
-
AcitveWindowChanged: is fired after the active window is changed. Its arguments provide one property:
- DockWindow: returns the activated window.
Considering the same scenario, where the currently active window is toolWindow2
, activating the toolWindow1
will first fire ActiveWindowChanging and if it is not canceled, ActiveWindowChanged will be fired. There, the DockWindow property from the event arguments will return toolWindow1
. In this case, you may also use RadDock.ActiveWindow that will also return toolWindow1
.
See Also
- AllowedDockStates
- Creating a RadDock at Runtime
- Creating ToolWindow and DocumentWindow at Runtime
- Customizing Floating Windows
- Customizing TabStrip Items
- Building an Advanced Layout at Runtime
- RadDock Properties and Methods
- Removing ToolWindow and DocumentWindow at Runtime
- Tabs and Captions
- ToolWindow and DocumentWindow Properties and Methods
- Accessing DockWindows