I'm using the XamDockManager as Region with NCAL. I have a simple patient search dock to the left. when I select a result, the patient get's opened up into a new tab in the DocumentContentHost. How do I get the newly created tab have focus and show if there are already multiple tabs showing?
Thanks for the help. I have it working now.
Ok, I'm also using the NCal project on codeplex, but one of the older versions that doesn't make use of the proxy objects. Anyway, you need to add an override Activate() method in the XamDockManagerRegion class.
Here is a sample of what I'm using, maybe it will help you to get it working in your project.
public override void Activate(object view) { DependencyObject depObj = view as DependencyObject; //Content Pane ContentPane contentPane = LogicalTreeHelper.GetParent(depObj) as ContentPane; //Split Pane string splitPaneName = depObj == null ? String.Empty : XamDockManagerSettings.GetSplitPaneName(depObj); SplitPane splitPane = DockManager.Panes.FirstOrDefault(sp => sp.Name == splitPaneName); //Tab Group bool isInTabGroup = ShouldAddViewToTabPaneGroup(view); if (isInTabGroup) { TabGroupPane tabGroupPane = splitPane.Panes.FirstOrDefault(elem => elem is TabGroupPane) as TabGroupPane; tabGroupPane.SelectedItem = contentPane; } base.Activate(view); }
Yeah NCAL is Infragistics on top of Prism. But using the .Activate doesn't work for anything I show inside the XamDockManagerRegion or the XamRibbonRegion. The views are inserted but they don't get focus.
By NCAL do you mean Prism? If so, then you should be able to get the region via the RegionManager and use the .Activate() method.