Detect if DockingWindow is docked to PrimaryDockHost

Docking/MDI for WPF Forum

Posted 2 years ago by Anton Chochia
Version: 17.2.0662
Avatar

Hi,

 

I need to detect if DockingWindow is docked to PrimaryDockHost when i drag docking window from floating window to primary dock host. When I undock first window and drag to somethere I receive DockSite.WindowsDragged event but both it's properties IsFloating is false and DockSite equals to PrimaryDockHost. If I undock the second window and drag into floating window container with first  window then it's IsFloating = true and DockSite is not PrimaryDockHost.  Currently, Code excerpt bellow:

if (!dockingWindow.IsFloating && dockingWindow.DockHost == dockingWindow.DockSite.PrimaryDockHost)

{

// Do something

}

Is there way to correctly detect if window dragged and docked into PrimaryDockHost?

Comments (5)

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Anton,

I just pasted your code into a sample and tried to reproduce this but was unable to.  Everything is working as expected in the lastest version and your 'if' statement fires at the right time.

I did look back at old code and some of the first builds of the Docking/MDI rewrite back in early 2016 did have the event fire before the layout change completed.  I suspect you are on one of those very old builds.  I'd recommend updating to a newer build, like 2017.2 and it will work better there.


Actipro Software Support

Posted 2 years ago by Anton Chochia
Avatar

Hi,

I'm on latest version (2017.2.0622). It works for any further dragged docking windows except for first one when I drag them into same floating window.

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Please give exact steps to reproduce in one of our samples, or send us a new simple sample project via our support ticket system so that we can see what you see.  Thanks!


Actipro Software Support

Posted 2 years ago by Anton Chochia
Avatar

Hi,

The behavior is reproduced when DockSite.UseDragFloatPreviews=true

Support ticket 262-21A7EB71-0011 is created. The  sample project was sent in separate email.

Thanks.

Answer - Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Anton,

Thanks for the sample.  It didn't occur until that UseDragFloatPreviews property was set.  We updated some code for the next build to resolve the issue.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.