Hello,
We are using the XamDockManager for our application. If we drag multiple tabs from the XamDockManager to a window the tabs appear on the bottom of the screen. We would like this to be on top of the screen like the main window.
Is this possible?
Kind regards
This is exactly what I was looking for.
Thanks!
Hi,
I've modified the styles and ControlTemplates in the sample.
The differences in appearance were because in the MainWindow the TabGroupPane was being hosted by a DocumentHost. In the floating pane that was created when you drag a tab from its initial location, a ToolWindow is created and the tab is added to it. Then when you add the second tab the TabGroupPane is created but of course it is being hosted by the ToolWindow. And as I said before there are triggers and different ControlTemplates based on where the TabGoupPane is being hosted.
I copied a ControlTemplate for the PaneTabItem of the DocumentTabItemTemplate and modified it, changing a DataTrigger to react to whether the Pane is and ActivePane (as opposed to to and ActiveDocument).
And also copied the style for the PaneTabItem Background when the TabStripPlacement is Top to use the same color as a DocumentHosted version
I tried to add comments where I made the changes. Look for <!—DS IG ..text.. />
Let me know if you have any questions.
Hello Marianne,
If I understood your response correctly I'll have to do both?
Adding the style in code to the resourcedictionary works perfectly, thanks!
However i'm unsure on how to proceed with the second part (the look of the tabs). I think that what you suggested is the right solution though. (customizing the DockableTabGroup ControlTemplate).
In your sample, you used a named static resource applied directly to the TabGroupPane in the DocumentContentHost. If you want to use that for the ToolWindow, you could add it directly in the ToolWindowLoaded event, including the NewButtonTabGroupPaneTemplate.
Style style = new Style(typeof(TabGroupPane));
Setter setter = new Setter(TabGroupPane.TabStripPlacementProperty, Dock.Top);
style.Setters.Add(setter);
setter = new Setter(TabGroupPane.TemplateProperty, this.Resources["NewButtonTabGroupPaneTemplate"]);
e.Window.Resources.Add(typeof(TabGroupPane), style);
You should also note that there is a difference between the DocumentTabGroup and its DocumentTabItem styles which are used when the TabGroupPane and PaneTabItem are hosted within a DocumentContentHost
The DockableTabGroupTemplate and its DockableTabItem styles are used when the TabGroupPane and PaneTabItem are not hosted within a DocumentContentHost.
In your case you may need to customize the DockableTabGroup ControlTemplate, as well, to match the style elements of the DocumentTabGroup.ControlTemplate that you need.
Please let me know if you have questions.
I can't seem to resolve the issue, so I've included a sample that contains a modified but representative control template that we use. The provided sample doesn't really do what we want either.
What we would like is exactly the same look in the main window and the "new window", including the look of the tabs, and this changes in the provided sample. For example the background of the tabheader is blueish whereas in the "new window" its gray/white.
I hope this clarifies the issue.