Floating Window loses active status

Docking/MDI for WPF Forum

Posted 9 years ago by Ray Huger
Version: 11.1.0540
Avatar
My app lets me float or dock documents. I want to update a status bar with info about the active window. I use the WindowActivated event for my main DockSite to alert me to changes. All is well between docked documents.

But a floating document stops being active when I click anywhere in the "chrome". Like in an empty space inside my main ribbon. What happens is that a docked document will become active even though I did not click in its window or tab.

How can I prevent this?

Comments (2)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Ray,

By clicking the chrome, you are passing focus to the Window, which will restore focus to the element that previously had the focus. To change this behavior, you would probably have to listen to the Window.Activated event and manually set the focus somewhere in the window being clicked.

WPF 4 adds a little better support for not "restoring focus" as explained here. We've made some tweaks to our Ribbon for WPF to better support the new "menu mode" feature, which will be included in the next maintenance release. But native WPF ToolBars will still steal the focus when a button is pressed.


Actipro Software Support

Posted 9 years ago by Ray Huger
Avatar
Thanks for that. The Visual Studio Blog sample for "menu mode" works perfectly when attached to my Actipro Ribbon.
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.