The Situation
So I have a Infragistics DockManager inside of an Infragistics Ribbon Window.
Inside my dock manager I have a number of separate user controls. Some of which have ribbon tab items specific to them.
When the content pane undocks from the dock manager and floats, it's tab is removed from the ribbon.
This happens because it is essentially being spawned into a new window. When it's added to a new window, it's being removed from the main ribbon windows' visual tree. Thus, it removes it's ribbon because it thinks it's gone.
The Proposed Solution
So to overcome this issue I have decided the best course of action would be to restyle the PanelToolWindow to be another ribbon window that would only display its children controls' ribbons.
The Problem
Every time I attempt to restyle the PanelToolWindow it doesn't work. I'm not sure why it's not working and there is practically zero documentation regarding restyling this window (please see links below for what documentation I did find).
The Sample Code
I've tried a few different solutions. Maybe it's how I am implementing the style.
Here is the basic template I have used.
<ControlTemplate TargetType="{x:Type igDock:PaneToolWindow}"
x:Key="documentViewerToolWindow">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition/>
</Grid.RowDefinitions>
<DockPanel Grid.Row="0" >
<ContentPresenter Content="{TemplateBinding Title}" />
</DockPanel>
<ContentPresenter Content="{TemplateBinding Content}" Grid.Row="1"/>
</Grid>
</Border>
</ControlTemplate>
I have attempted:
Adding the above control template into the User Control Resources just above the dock manager in a style that targets igDock:PaneToolWindow. The hope here was that it would just restyle every PaneToolWindow that's floating. This didn't work
Adding the above control template into the App.XAML Resources. This didn't work.
I then attempted to restyle the dock manager explicitly with the below code
<Style TargetType="igDock:PaneToolWindow"> <Setter Property="Style" Value="{StaticResource ResourceKey=documentViewerToolWindow}"/> </Style>
I have also attempting setting UseOSNonClientArea = false within the ToolWindowLoaded event AND by hard coding it into the DockManager's XAML tag. Neither of which worked.
I have tried pulling the Window.Content out of the PaneToolWindowEventArgs.Window.Content property and spawning them into my custom Window.ContentControl.Content property. This works but with VERY bad behaviors like duplicate windows on loading.
Refrences
http://www.infragistics.com/community/forums/t/60620.aspx
See Question&Answers more detail:os