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

Parents
  • 16495
    Offline posted

    Hello Prikanwar,

    I followed your approach and based on the code snippet you provided I have created simple sample application. I was unable to reproduce the behavior you're describing.  I have attached the sample project I used to test this and a .gif file where you can see how it works on my side.  Please test this project on your PC, whether or not it works correctly may help indicate the nature of this problem. If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using. 

    My test was performed using version 16.2 – 1006(RTM) and 16.2 - 2036 of WPF product. If the project does show the product feature working correctly, this indicates a possible problem in the code of your application.  It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing. Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.

    Please let me know if I can provide any further assistance.

    Sincerely,
    Zhivko
    Entry Level Software Developer

    AddTabs.zip
Reply Children