Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
590
How to dynamically add multiple XAMTab with one content ?
posted

Hi,

We would like to add multiple Tab in XAMDockManager. We tried to add multiple tabs with one content, but Nothing showing in design view.

We have added code in parametrized page class constructor. in this way.

 DocumentContentHost dch = new DocumentContentHost();

            SplitPane rootSplit = new SplitPane();
            rootSplit.SplitterOrientation = Orientation.Vertical;

            TabGroupPane tgpRoot = new TabGroupPane();

            ContentPane cpFile1 = new ContentPane();
            cpFile1.Header = "File 1";
            cpFile1.Content = new RichTextBox();
            tgpRoot.Items.Add(cpFile1);
            rootSplit.Panes.Add(tgpRoot);

           SplitPane nestedSplit = new SplitPane();
           nestedSplit.SplitterOrientation = Orientation.Horizontal;

            TabGroupPane tgpNested1 = new TabGroupPane();
           ContentPane cpFile3 = new ContentPane();
            cpFile3.Header = "File 3";
            cpFile3.Content = new RichTextBox();
            tgpNested1.Items.Add(cpFile3);
           nestedSplit.Panes.Add(tgpNested1);

           TabGroupPane tgpNested2 = new TabGroupPane();
           ContentPane cpFile4 = new ContentPane();
            cpFile4.Header = "File 4";
           cpFile4.Content = new RichTextBox();
            tgpNested2.Items.Add(cpFile4);
            nestedSplit.Panes.Add(tgpNested2);

            rootSplit.Panes.Add(nestedSplit);
            dch.Panes.Add(rootSplit);

            PetInfoDockManager.Content = dch;

We have already created one content page which we would like to show in all tabs.

Even though we have tried in another way.

<igDock:XamDockManager x:Name="PetInfoDockManager">
                       <igDock:XamDockManager.Content>
                        <igDock:DocumentContentHost Name="PetInfoDocumentContentHost">
                            <igDock:DocumentContentHost.Panes>
                                <igDock:SplitPane x:Name="PetINfoDocumentContentSplitpane">
                                    <igDock:TabGroupPane x:Name="PetInfoDocumentContentTabGroupPane">

                                      <igDock:ContentPane> </igDock:ContentPane>
                                    </igDock:TabGroupPane>
                                </igDock:SplitPane>
                            </igDock:DocumentContentHost.Panes>
                        </igDock:DocumentContentHost>
                    </igDock:XamDockManager.Content>
                    <igDock:XamDockManager.Panes>
                    </igDock:XamDockManager.Panes>

 </igDock:XamDockManager>

            TabGroupPane tgpNested1 = new TabGroupPane();
            ContentPane cpFile4 = new ContentPane();
            cpFile4.Header = "File 4";
            cpFile4.Content = new RichTextBox();
            tgpNested1.Items.Add(cpFile4);
            PetINfoDocumentContentSplitpane.Panes.Add(tgpNested1);
            PetInfoDocumentContentHost.Panes.Add(PetINfoDocumentContentSplitpane);

But still we are in same track.

Please let us aware your help would be appreciate.

Thanks