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.
Hi,
Let me know if this code resolves your question.
e.Window.Resources.MergedDictionaries.Add(this.Resources.MergedDictionaries[0]);
I'm afraid that doesn't resolve the issue. I verified in debug that the resources are copied and that the controltemplate used is in the resource dictionary.
I’ll add Val’s sample updated with my last suggestion. You’ll see that I have added comments to the ResourceDictionary file and to the MainWindow xaml and the code behind. There are several methods depicted in the sample but only one currently being used.
The only one currently uncommented is using the ResourceDictionary file referenced in the MainWindow MergedDictionary Resources xaml and then retrieved in the code behind and added to the ToolWindow’s resources’ MergedDictionaries.
I think that most closely represents what you have described.
In the resource file I have a slightly modified Control Template. I set the BorderBrush to Blue just to confirm that it was being applied. It also has a TabGroupPane style to set the TabStripPlacement to Top and the BorderBrush to Red.
Please run my sample and let me know if you see any issues.
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 that demonstrates the issue if you have one.
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.
This is exactly what I was looking for.
Thanks!
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.. />
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.