AutoHidePopupClosesOnLostFocus working as intended?

Docking/MDI for WPF Forum

Posted 4 years ago by Farris
Version: 19.1.0684
Avatar

Hello,

I have a dialog window that shows a auto hidden ToolWindow (sets IsOpen, IsActive and IsSelected to true) upon closing of the dialog. However, the ToolWindow is just briefly visible before it is hidden again. 

This seems to be because a different control gets focus when the dialog is closed.

When looking through the Actipro WPF Studio documuntation, I found the AutoHidePopupClosesOnLostFocus property that sounded like it would solve the issue. However this didn't seem to do make the ToolWindow behave any different. 

What I've done is set AutoHidePopupClosesOnLostFocus to false before opening the dialog, show the hidden ToolWindow, then when the dialog is closed I enable AutoHidePopupClosesOnLostFocus again. I also tried having this property always set to false. 

Edit: Btw, I've solved this in a different way now, by activating the ToolWindow after the dialog is closed. 

[Modified 4 years ago]

Comments (1)

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

Hi Farris,

I believe that should generally work.  For instance if in our main Simple IDE demo I set AutoHidePopupClosesOnLostFocus to false, I can show the auto-hidden tool window, then do the File/Open command to show an OpenFileDialog.  The auto-hide popup remains visible the entire time, even when the dialog is closed.

That being said, the AutoHidePopupClosesOnLostFocus property only works if focus is kept within the same tool window.  If focus moves to another docking window, then that property is not used.  I suspect that's what's going on with your scenario.

Note that sometimes focus operations like when you call ToolWindow.Activate() get BeginInvoked if they don't initially succeed.  I wonder if that is part of the issue here.

What if you did a Dispatcher.BeginInvoke call to show the dialog?  Does that help delay things so that the focus operations can complete first?

Anyhow, I'm glad you solved it a slightly different way.


Actipro Software Support

The latest build of this product (v24.1.1) 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.