ToolsWindow.IsOpen is false even though the tools window is docked and visible.

Docking/MDI for WPF Forum

Posted 21 days ago by Pelle Hansson
Version: 19.1.0686
Avatar

Just upgraded from v2016.1, build 635 to v2019.1 build 686.

We have a tools panel from which the user can drag&drop a tool onto an DockSite.  The tools panel contains just icons and the drag&drop is implemented by overriding the OnMouseMove(). Within that event handler we do the following:

1) subscribe to the DockSiteOnWindowDragged event

2) create the appropriate ToolsWindow

3) use the DragMove() method of the ToolsWindow to allow for docking.

4) We do not allow floating windows, so upon getting the DockSiteOnWindowDragged event, we want to know if the user hit or missed a docking "landing area". We used to do this by inspecting the windows IsOpen property. It was true if window was docked and false otherwise. If false we could go ahead and destroy the window to save memory.

Problem, after upgrading to latest version the IsOpen property is always false, no matter what.

Questions:

1) Has there been any changes as to how the IsOpen property is implemented?

2) What would be the proper way to inspect whether or not a window was docked successfully?

Any help would be much appreciated

[Modified 21 days ago]

Comments (9)

Posted 21 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Pelle,

IsOpen should be true if the docking window is anywhere in the docking layout.  It should be true if the docking window is docked or floating.  We aren't aware of any bugs with it returning incorrect values right now other than this bug that is getting fixed in the upcoming maintenance release:

Fixed a bug where setting DockingWindow.IsOpen to false within the XAML of a nested DockSite might not close the docking window.

It's hard to say what might cause the property to be different between versions, but if you would like to put together a new simple sample project that shows it happening, we can have a look.  Please send that to our support address and reference this thread.  Be sure to rename the .zip file extension so it doesn't get spam blocked.

If a docking window is docked in the DockSite itself (not in a floating window), its IsOpen property should be true and its DockHost property should be the same as the DockSite.PrimaryDockHost.

The only other thing I can think of is perhaps the event is firing in a sequence before IsOpen is updated now?  I wonder what happens if you dispatcher.BeginInvoke your logic from that event, if you see a different IsOpen value then.


Actipro Software Support

Posted 19 days ago by Pelle Hansson
Avatar

Thank you for your quick reply. 

I'm sending over a small test project that demonstrates the effect.

Posted 19 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Pelle,

I checked and we didn't receive anything yet.  In case you sent it, please try again and make sure you remove the bin/obj folders from the ZIP that is sent, since the presence of those will sometimes trigger spam blocking too.


Actipro Software Support

Posted 19 days ago by Pelle Hansson
Avatar

The email got recjected.

I have removed obj and bin folders. Zipped the project folder and renamed to .txt. Also adding som chars in the beginning and end of that text-file did not help.

I even tried to base64 encode the renamed zip-file and sent it to my own gmail account as a test. It got rejected as well and I assume the same will happen if I send it to you.

I have included a libs folder though containing your dll's. Just so that the demo project will work right out of the box.

Do you have any other ways for me to upload the project?

Posted 19 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Gmail tends to have overlay aggressive spam blocking if there are any .dll or .exe files in the ZIP.  Usually if you leave all those out, it will work to come through. 

As an alternative, you can go to our ticket system too and should be able to create a ticket and upload the attachment directly.


Actipro Software Support

Posted 19 days ago by Pelle Hansson
Avatar

Now I have submitted a new ticket. Reference no 3D1-270735EA-0022

Answer - Posted 19 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello, thank you for the sample project.  We found the issue is that our layout logic wasn't raising the WindowsOpening/ed events when drag/dropping an already-closed docking window.  The IsOpen flag gets updated in the logic that raises the WindowsOpened event, so that's why it wasn't in sync.  We've fixed this for the upcoming maintenance release.


Actipro Software Support

Posted 18 days ago by Pelle Hansson
Avatar

Thank you!

When can we expect the next release to become available?

Posted 18 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

It should be released any day now.


Actipro Software Support

The latest build of this product (v2020.1.0) was released 17 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.