Hello,
We have a requirement that all the pane's share the same focus scope. This is so that we don't have ribbon contextual groups showing up from multiple logical scopes across different panes that all have focus.
Setting FocusManager.IsFocusScope="False" on the ContentPane resolves this issue for us, however, it introduces a new issue. When the window is floated, you can no longer tab through controls. I have verified this is still an issue in 14.2. Anyone how I might have floated pane's share the same focus scope? I thought maybe overriding GetUIParentCore to return the XamDockManager, but that did not resolve it.
Example xaml that demonstrates the issue:
If you are referring to the RaiseEvent call I make above, that was an attempt at fixing the tab navigation issue and routed command issues. Removing it doesn't make a difference.
The original post contains the full xaml (no changes in code behind) that reproduced the issue.
What I didn't understand is why the infragistics tool window wasn't becoming a focus scope. This is the window that gets created by XamDockingManager for the content pane when it gets floated. At this point, I am re-working a lot of our software to just play better with multiple logical focus scopes. There is definitely a lot of magic that seems to be happening under the WPF covers that I am not fully understand, but your above links have definitely helped clear some understanding for me.
Hello Mike,
After some more research and collaborating with our development team on this matter, it appears that this issue may be getting caused by the RoutedEventDispatcher method. It appears that what is happening is that you are catching every routed event on the window, re-routing it, and then re-raising it. When I tried not re-raising the events, the tab navigation came back. For the time being, I would like you to comment out the rerouting to the RoutedEventDispatcher in your project, and see if the tab navigation issue still persists.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
In WPF windows are their own focus scopes by default, and because of this, I am not seeing the functionality that is being accomplished by the workaround above. When a pane is floating in the xamDockManager, it is in its own window, and so it is its own focus scope. In other words, the floating panes in the XamDockManager are not so much sharing the same focus scope as they are establishing themselves as their own focus scope. I have found another article online that deals with focus scope that may help you further on this. The link is below.
http://www.codeproject.com/Articles/38507/Using-the-WPF-FocusScope.
To be honest, I am still somewhat unsure of the functionality you are really trying to achieve with this, and I am curious if it can be achieved without the need to delve into different focus scopes on the floating panes. Could you please provide some more detail on the requirement you are trying to achieve?
I'm not sure what your overall goal is, but this post might be worth a read. It shows you how to execute commands on a Ribbon to the active floating pane of the xamDockManager.
http://brianlagunas.com/wpf-xamdockmanager-floating-panes-and-xamribbon-menu-integration/
Hopefully this helps a little.
Don't worry about the ribbon groups. It is not issue I need help with. We have an attached behavior that when a control gets focus, it will make a ribbon group visible. When it loses focus, it will hide the ribbon group. By making all the pane's share focus scope, then I can easily track logical focus instead of keyboard focus. The other part to this is we do all our bindings on LostFocus. This means that when the end user clicks save, we have to simulate a lost focus to get the data pushed up. With different focus scopes on the content pane, it makes things much more challenging.
What is interesting about setting the focusscope to false is that it works correctly when not floated. It technically works correctly when floated too, meaning the panes across multiple windows seem to share the same focus scope. The main issue I am trying to solve is the broken tabbing functionality. It works fine if I used XamTextEditor, or XamComboBox, but not with TextBox or ComboBox.
I have already read that MSDN thread. It got me part of the way to my current solution. In order to get the ribbon to work from floated pane's i had to do some similar things to what is in that thread. Handling PreviewGotKeyboardFocus in the ribbon. I also had to explictely set CommandTargets to Keyboard.FocusedElement on all my routed commands. I then had to have my floated pane's route all events up through the XamDockManager.
I wireup to MainDockingManager.ToolWindowLoaded += MainDockingManager_ToolWindowLoaded;