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
When you float a pane the Dock Manager fires the ToolWindowLoaded event. You can handle this event to and add a style to the new Tool Window’s Resources which sets the TabStripPlacement property to Top for the TabGroupPane. This will add the Tabs at the top of the Tab Group Pane when it is created.
See attached sample.
Let me know if you have any questions.
Sincerely,
Valerie
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
The solution you suggested works.
However wa applied a controltemplate to the tabs and we would like this to be applied. (It also puts the tabs on top).
We've tried to copy the resourcedictionary using the following code:
private void MainDockMagager_ToolWindowLoaded(object sender, Infragistics.Windows.DockManager.Events.PaneToolWindowEventArgs e) { e.Window.Resources = this.Resources.MergedDictionaries[0]; }
The resources seem to be copied but not applied to the tabs, but do get applied for the content.
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.
Hi,
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.
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).
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.. />
This is exactly what I was looking for.
Thanks!