I am trying to make the content of a ContentPane fill the entire available area when the pin/close buttons and header are collapsed. When I do this, I am left with some white space at the top of the content that I am not sure how to get rid of.
I set up the content pane as so:
var contentPane = new ContentPane { Content = contentControl, AllowPinning = module.AllowPinning, AllowClose = !module.Required, AllowDockingFloating = module.AllowFloating, AllowDocking = true, Image = null, PinButtonVisibility = module.AllowPinning ? Visibility.Visible : Visibility.Collapsed, WindowPositionMenuVisibility = Visibility.Collapsed, CloseButtonVisibility = module.Required ? Visibility.Collapsed : Visibility.Visible, HeaderTemplate = Application.Current.FindResource("DockingViewHeaderTemplate") as DataTemplate };
Then to hide the header text, I use the DockingViewHeaderTemplate:
<this:StringEmptyConverter x:Uid="Converters:StringEmptyConverter" x:Key="StringEmptyConverter"/>
<DataTemplate x:Uid="DockingViewHeaderTemplate" x:Key="DockingViewHeaderTemplate" > <TextBlock Text="{Binding}" Visibility="{Binding Converter={StaticResource StringEmptyConverter}}"/>
</DataTemplate>
Thank you Michael, that did the trick.
Hello Tanner,
Thank you for following up. The visibility of a element can be toggled with a trigger in XAML, but there is probably a reason why it's visible in the first place. That of which I do not know off hand. The default styles that are preloaded into our components have default settings, changing them can cause unexpected behavior, but you can remove the property being set and create your own implicit style to change when the visibility is triggered.
The default styles are located on your machine here:
C:\Program Files (x86)\Infragistics\201x.x\WPF\DefaultStyles\DockManager
Let me know if you have any questions.
So I took a look at the source code with a decompiler and found the style for a ContentPane. This is the code I'm interested in:
<igDock:PaneHeaderPresenter Content="{TemplateBinding HeaderedContentControl.Header}" ContentTemplate="{TemplateBinding HeaderedContentControl.HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderedContentControl.HeaderTemplateSelector}" Visibility="{TemplateBinding igDock:ContentPane.HeaderVisibility}" DataContext="{Binding RelativeSource={x:Static RelativeSource.TemplatedParent}}"/>
I'm thinking the reason I'm seeing that extra space is the HeaderVisibility property isn't getting changed to collapsed internally when all of it's child controls are getting set to collapsed. Do you have any idea how I can make sure the HeaderVisibility gets set to collapsed?
Hi Michael,
My company unfortunately has a propriety framework that they have built on top of Infragistic's Dock Manager, so i cannot share any project that uses these libraries. This being the case, I also do not have access to any Infragistics source code, I just have the InfragisticsWPF4.DockManager.v14.2.dll.
I have confirmed that changing the background of the content pane changes the color of that bar at the top, so that space is declared for the content pane somewhere. I just have no idea where to look.
Hello,
Please provide a sample that illustrates the area inwhich you want to remove.
You should be able to retemplate and change what you don't want in the XamDockManager's default templates.
You can find default templates on your computer in the file: \Infragistics\NetAdvantage20xx.x\WPF\DefaultStyles\DockManager\DockManagerGeneric.xaml copy them in your code and change the properties you want to customize.