Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
430
Hide space above header in content pane
posted

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>