NCAL sample not dynamically adding views to a module

Sep 1, 2009 at 3:09 AM

Hi Guys,

                   Thanks very much for your work, we are about to purchase the infragistic licenses for our large gov project however I am having a problem getting the dynamic addition of views to a region.

The example NCAL application only adds a view to a static pane defined in the shell that is not a CAL region for a module.

It would be really nice if you guys could update the sample to handle the senario of dnyamically adding controls to CAL regions.

  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>