I found the PaneNavigatorButton not working properly when using nested DockManagers. 1. Compile and execute the attached code 2. Press the PaneNavigatorButton or press Ctrl+Tab 3. Pane Navigator of outer DockManager is shown (= OK) 4. Focus the inner DockManager (i.e. select Tab "Doc 2") 5. Press the PaneNavigatorButton or press Ctrl+Tab 6. No Pane Navigator is shown (= problem)Is this a known problem or is something wrong with my code?Thanks,
Patrick
Same Code as in attachement
xaml:
-----
<Window x:Class="WpfTest.Window2" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:dock="clr-namespace:Infragistics.Windows.DockManager;assembly=Infragistics3.Wpf.DockManager.v9.1" Title="Window2" Width="800" Height="600" > <dock:XamDockManager PaneNavigatorButtonDisplayMode="Always"> <dock:DocumentContentHost> <dock:SplitPane> <dock:TabGroupPane> <dock:ContentPane Header="Document"> <dock:XamDockManager ExecutingCommand="XamDockManager_ExecutingCommand"> <dock:DocumentContentHost> <dock:SplitPane SplitterOrientation="Horizontal"> <dock:TabGroupPane> <dock:ContentPane Header="Doc 1" AllowClose="False" AllowDockingFloating="False" AllowFloatingOnly="False" /> <dock:ContentPane Header="Doc 2" AllowClose="False" AllowDockingFloating="False" AllowFloatingOnly="False" /> </dock:TabGroupPane> </dock:SplitPane> </dock:DocumentContentHost> </dock:XamDockManager> </dock:ContentPane> </dock:TabGroupPane> </dock:SplitPane> </dock:DocumentContentHost> <dock:XamDockManager.Panes> <dock:SplitPane> <dock:ContentPane Header="Tool" /> </dock:SplitPane> </dock:XamDockManager.Panes> </dock:XamDockManager></Window>
xaml.cs:
----
using Infragistics.Windows.Controls.Events;using Infragistics.Windows.DockManager;namespace WpfTest{ public partial class Window2 { public Window2() { InitializeComponent(); } private void XamDockManager_ExecutingCommand(object sender, ExecutingCommandEventArgs e) { if (e.Command == DockManagerCommands.ShowPaneNavigator) { e.Cancel = true; } } }}
I was able to get the behavior you described using your sample. I submitted the issue for review. The issue relates to the fact the inner dockmanager assumes that it can execute the showpanenavigator command so essentially it gets the command routed to it for execution only to have it cancelled by the executing command. For now, you could in the inner dockmanager execute the command for the outer dockmanager.
This solution works if both XamDockManagers are declared in the same XAML (which is only the case in my simplified example). In a real world application the workaround would be more like:
if (e.Command == DockManagerCommands.ShowPaneNavigator){ e.Cancel = true; FrameworkElement fe = Parent as FrameworkElement; while (fe != null && !typeof(XamDockManager).IsInstanceOfType(fe)) { fe = fe.Parent as FrameworkElement; } XamDockManager outer = fe as XamDockManager; if (outer != null) { outer.ExecuteCommand(DockManagerCommandsShowPaneNavigator); }}
Thanks for your answer, Patrick