Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
170
How do I control a Floating ContentPane from a button within a Ribbon on the Main Window?
posted

Our application uses the NetAdvantage WPF controls extensively.  The main window has a ribbon with buttons, and then a DockManager/DocumentContentHost that contain multiple ContentPane documents.

When clicking a button on the Ribbon, we want to invoke certain actions on the currently active ContentPane.  We do this by parsing through dockManager.GetPanes() and finding the ContentPane with the IsActivePane currently true, so we can find the last active ContentPane and do the required action on it.

This works fine when all the ContentPanes are within tabs or are docked .  However when a ContentPane is floating, and when a button is clicked on the Ribbon, focus goes back to one of the tabs on the Main Window.  Hence in code, the newly focussed tab is the one acted on, instead of the floating ContentPane that was meant to be acted on.

This behavior is different from that of Visual Studio 2008.  If you float a window within VS, you can click on any of the buttons or menu options on the Main Window within VS, but focus stays on the floating window.  You can try this by using any floating window within VS and the Undo toolbar button within the main window.

Could you please let me know how I can get a button on a Ribbon to work with a floating ContentPane without focus changing back to the Main Window?

Thanks in advance.

  • 54937
    Offline posted

    Currently there is no way to prevent this. The floating windows are in two different WPF windows and in WPF when you click on a menu/toolbar button/etc. it will take keyboard focus which will activate that window. In VS, you will notice that the keyboard focus is still in the floating window and VS just intercepts the key messages to route them to the menu.