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
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, ZhivkoEntry Level Software Developer
Thanks for your support. I was just doing to add code in Tab selection changing In these case UI is not going to update. But in default constructor of page and another button event action this code is working. We have one more query that we would like to add one content page for all Tabs selection.
We have already created UI in same page and same content we want to render for all tabs selection. Please let us suggest how we can approach it.
I have reviewed your requirement about how to render same content for all ContentPanes in XamDockManager that you are trying to achieve and an available approach is to set the Content property of ContentPane to method that returns a new UserControl with content you want, for example:
public UserControl AddSameContent(){ UserControl control = new UserControl(); control.Content = new TextBlock() { Text = "test" } return control;} ContentPane cpFile1 = new ContentPane();cpFile1.Header = "File 1";cpFile1.Content = AddSameContent();tgpRoot.Items.Add(cpFile1);rootSplit.Panes.Add(tgpRoot);
ContentPane cpFile1 = new ContentPane();cpFile1.Header = "File 1";cpFile1.Content = AddSameContent();tgpRoot.Items.Add(cpFile1);rootSplit.Panes.Add(tgpRoot);
I have modified the attached sample application in order to show you how can implement my suggestion.
Please let me know if you require any further assistance regarding this matter.