This project is read-only.

Single document in DocumentPane

May 9, 2011 at 10:53 AM


I have a scenario where I want to have just one document in the central area of the window and dockable panels around it. In this case close button, document title and other controls are not needed (since I have just one 'document', or more accurately one window with the main content) and these controls may even confuse users. What I want to achieve is to render just the content of the current document in DocumentPane and maybe a border, but nothing more. So far I have the following ControlTemplate, which works almost fine. The problem is that when I start the program, the DocumentPanel does not stretch over the available area and it's half its normal size. What should I do in order to stretch it? 

The TemplateControl code:

<ControlTemplate TargetType="{x:Type ad:DocumentPane}" >
  <Border BorderThickness="2" 
               Margin="2, 2, 2, 2" 
             Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedItem.Content}"/>