Detect whether the window is hosted in DockingManager
31 May 20211 minute to read
There two ways to detect whether a FrameworkElement is hosted in DockingManager or not. They are:
- Getting DockingManager instance for a FrameworkElement and checking whether it is null or not.
- Detecting whether the FrameworkElement is present in the Children collection of DockingManager.
The two ways are shown below:
//Getting DockingManager Instance. DockingManager manager=DockingManager.GetDockingManager(element1); //Checking whether element1 is in children collection. DockingManager.Children.Contains(element1);