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:
I am good, thanks Andrew.
Hello mikebm,
Just checking in, did you have any other questions or concerns on this matter?
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Thank you for your response.
I have reproduced the behavior that you have described, but it appears that by removing the FocusManager.SetIsFocusScope(pane, true); line from your ToolWindowLoaded code, you are essentially getting the same effect as in your original post with the FocusManager.IsFocusScope = "False" being set on the ContentPane.
The reason is because when you re-dock the pane in the dock manager, the e.Window.Closed delegate fires, setting the ContentPane's focus scope to false. When you float the pane, the ToolWindowLoaded event fires again for the new window, but the ContentPane is still the same pane. Since the FocusManager.SetIsFocusScope(pane, true); is now removed, the FocusManager.IsFocusScope property remains false when the pane is floated, and so the tab navigation is disabled.
I would recommend that you leave the FocusManager.SetIsFocusScope(pane, true) code in your ToolWindowLoaded event if you wish to keep the tab navigation enabled in this case.
Please let me know if you have any other questions or concerns on this matter.
Hi Andrew,
The reason your example works is because you have my workaround code in place which is to re-enable the focus scope on the pane when floated. When unfloated, they all share the same focus scope, when floated, I had to re-enable the focus scope so that tab navigation works. This is being done by the following line:
FocusManager.SetIsFocusScope(pane, true);
Get rid of that, and your tab navigation will stop.
I am glad that the links that I had sent have helped to clear up this issue a bit.
After a bit more research, I believe that I have found why the Infragistics tool window does not become a focus scope. This is expected, since the PaneToolWindow that is returned by e.Window in the ToolWindowLoaded event is hosted by an internal window named ToolWindowHostWindow.
Regarding the RaiseEvent call removal not making a difference, I cannot say that I can reproduce that behavior. Using the code you provided, with a small modification to retrieve the ContentPane since I am unsure what your FindChildByType method is doing. If I remove the code that calls the RoutedEventDispatcher completely, the tab navigation comes back. I have attached the sample I have been using to demonstrate. This sample was tested using Infragistics for WPF 2014 Volume 2, specific version 14.2.20142.2081.