PRISM project:
I'm trying to add views (usercontrols) to a TabGroupPane in XamDocManager. I'm getting errors about the control type, and am guessing that I need a RegionAdapter for this. For doing something similar with XamRibbon, I created a RibbonRegionAdapter (not with NCAL). Now, I want to explore NCAL. Can someone tell me why specifically I should use NCAL. And does NCAL have the other RegionAdapters I will need? Specifically for TabGroupPane.
Is the project on CodePlex the only sample projects available for NCAL? Or does Infragistics provide any? Also, why is NCAL not supported from Infragistics?
Thanks in Advance.
There is a better xamDockManager Prism region adapter here:
http://brianlagunas.com/xamdockmanageran-updated-prism-region-adapter/
I'm not sure what you mean by an extra tab group pane. I took your snippet and used that within the NCAL SampleBrowser sample. I essentially replaced the OnAddNewViewButtonClick of the ShellWindow.xaml.cs file with your code. When I run the sample and click the AddNewView button, a new SplitPane docked to the left (but just to the right of the split pane that contains the Hello World, CurrentTime and Goodbye World views. If I click the Add New View multiple times, new views are added to that new split pane and they are displayed as a tab group. Now, if you were trying to have these new views be within the same tab group that already existed (the one in the originally displayed SplitPane that contained the Hello World and Current Time views), then you would want to set the SplitPaneName on the view to the same SplitPaneName used for the split pane that is on the left - which in the case of this sample is SPLITPANE_LeftSide.
The following is the code I used to test this. I left the setting of the splitpanename commented out so you could test with and without it.
Can you update the NCAL example to handle dynamically adding views to a tabgrouppane which is in a module region?
Hi Guys,
I have the following code for dynamically adding a control to a CAL region
I am seeing my control added to a tabgroupane however I am getting an extra tabgroup pane with
nothing in it. My XAML is below as well. Can you tell me why I am getting the extra tabgrouppane?
public void AddElementText(string elementText, IRegionManager regionManager) { TextBlock view = new TextBlock { Text = elementText }; Style contentPaneProxyStyle = new Style(typeof(ContentPaneProxy)); string header = "test element"; contentPaneProxyStyle.Setters.Add(new Setter(ContentPane.HeaderProperty, header)); XamDockManagerSettings.SetContentPaneProxyStyle(view, contentPaneProxyStyle);
//XamDockManagerSettings.SetSplitPaneName(view, "LeftSidePaneName"); XamDockManagerSettings.SetSplitPaneProxyStyle(view, SplitPanes.Styles.LeftSidePane);
XamDockManagerSettings.SetIsContentPaneInTabGroup(view, true); //IRegionManager regionMgr = RegionManager.GetRegionManager(this.dockManager); //IRegion region = regionMgr.Regions[AQIS.ICON.Infrastructure.RegionNames.DockingAreaRegion]; IRegion region = regionManager.Regions[AQIS.ICON.Infrastructure.RegionNames.DockingAreaRegion]; region.Add(view); }
<Window x:Class="AQIS.ICON.Client.Shell.Shell" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cal="http://www.codeplex.com/CompositeWPF" xmlns:igDock="http://infragistics.com/DockManager" xmlns:inf="clr-namespace:AQIS.ICON.Infrastructure;assembly=AQIS.ICON.Infrastructure" xmlns:res="clr-namespace:AQIS.ICON.Resources;assembly=AQIS.ICON.Resources" Title="{x:Static res:Strings.ShellWindow_Title}" Width="900" Height="600" WindowStartupLocation="CenterScreen" > <igDock:XamDockManager x:Name="dockManager" cal:RegionManager.RegionName="{x:Static inf:RegionNames.DockingAreaRegion}" Theme="Royale" > <!--<igDock:ContentPane x:Name="ElementEditorPane" >
</igDock:ContentPane>--> <igDock:XamDockManager.Panes> <igDock:SplitPane x:Name="staticSplitPane" igDock:XamDockManager.InitialLocation="DockedRight"> <igDock:SplitPane.Panes> <igDock:ContentPane Header="Search" MinHeight="100" cal:RegionManager.RegionName="{x:Static inf:RegionNames.SearchRegion}" >
</igDock:ContentPane> </igDock:SplitPane.Panes> </igDock:SplitPane> </igDock:XamDockManager.Panes>
</igDock:XamDockManager>
</Window>
Well with regards to NCAL, the TabGroupPaneProxy is created by the xamDockManagerRegion when the attached XamDockManagerSettings.IsContentPaneInTabGroup is true; it is never used directly within your project. So if you have multiple views that you want to be within the same pane you would set the XamDockManagerSettings.SplitPaneName to the same value and set the XamDockManagerSettings.IsContentPaneInTabGroup to true for both. This is done in the sample project that is included with the project on CodePlex and that is how the "Current Time" view and the "Hello World" view are placed within the same tabgroup in the left split pane.
With regards to the ribbon there is currently no regionadapter created for xamRibbon. You would need to create one and manage creating the appropriate object for your project for a view that is to be adapted. You may want to submit a suggestion for adding this to the NCAL project.