title: WPF C# making control occupy the entire area of its parent
body: <p>I have a TabControl that contains TreeListControl.
  I am looking for way that TreeListControl will alway occupy the entire area of the Tab, even when the Tab size changes as the result of application size change, etc. How do I do that? (Unfortunately I don't see any equivalent to WinForms' Dock.Fill)</p>
  
  <pre><code>            &lt;dxdo:DockLayoutManager FloatingMode="Desktop" ClosedPanelsBarVisibility="Never"&gt;
              &lt;dxdo:LayoutGroup Orientation="Horizontal"&gt;
                  &lt;dxdo:LayoutPanel x:Name="Navigation" Caption="Navigation" AllowClose="False" ItemWidth="200"&gt;
                      &lt;dx:DXTabControl&gt;
                          &lt;dx:DXTabItem Header="Tasks"&gt;
                              &lt;Grid Background="Transparent"&gt;
                                  &lt;dxg:TreeListControl AutoGenerateColumns="AddNew" EnableSmartColumnsGeneration="True" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="254" Width="151"&gt;
                                      &lt;dxg:TreeListControl.View&gt;
                                          &lt;dxg:TreeListView AllowPerPixelScrolling="True" ShowTotalSummary="True" Height="291" Margin="-17,-19,-24.4,-19.2" VerticalAlignment="Bottom" /&gt;
                                      &lt;/dxg:TreeListControl.View&gt;
                                  &lt;/dxg:TreeListControl&gt;
                              &lt;/Grid&gt;
                          &lt;/dx:DXTabItem&gt;
                          &lt;dx:DXTabItem Header="Blocks"&gt;
                              &lt;Grid Background="Transparent"/&gt;
                          &lt;/dx:DXTabItem&gt;
                          &lt;dx:DXTabItem Header="Functions"/&gt;
                      &lt;/dx:DXTabControl&gt;
                  &lt;/dxdo:LayoutPanel&gt;
                  &lt;dxdo:DocumentGroup x:Name="Documents" DestroyOnClosingChildren="False" ClosingBehavior="HideToClosedPanelsCollection" 
                                      dxmvvm:UIRegion.Region="{x:Static common:Regions.Documents}"&gt;
                      &lt;dxdo:DocumentGroup.ItemStyle&gt;
                          &lt;Style TargetType="{x:Type dxdo:LayoutPanel}"&gt;
                              &lt;Setter Property="Caption" Value="{Binding Caption}"/&gt;
                              &lt;Setter Property="IsActive" Value="{Binding IsActive, Mode=TwoWay}"/&gt;
                          &lt;/Style&gt;
                      &lt;/dxdo:DocumentGroup.ItemStyle&gt;
                  &lt;/dxdo:DocumentGroup&gt;
              &lt;/dxdo:LayoutGroup&gt;
          &lt;/dxdo:DockLayoutManager&gt;
  </code></pre>
  
  <p>I wanted to try the suggestions but stumbled on the runtime error on Line 74, pos 7. Specifically in this -  - one line before the last. No idea why... here is the complete code (the last line of closing UserControl tag is not showing here for some reason:</p>
  
  <pre><code>&lt;UserControl
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
           xmlns:common="clr-namespace:PLCProg.Common;assembly=PLCProg.Common"
           xmlns:views="clr-namespace:PLCProg.Main.Views"
           xmlns:viewModels="clr-namespace:PLCProg.Main.ViewModels"
           xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
           xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
           xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
           xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon"
           xmlns:dxn="http://schemas.devexpress.com/winfx/2008/xaml/navbar"
           xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
           xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:dxdiag="http://schemas.devexpress.com/winfx/2008/xaml/diagram" x:Class="PLCProg.Main.Views.MainView"
           mc:Ignorable="d" d:DesignHeight="500" d:DesignWidth="600"
           d:DataContext="{dxmvvm:ViewModelSource {x:Type viewModels:MainViewModel}}"&gt;
  &lt;dxmvvm:Interaction.Behaviors&gt;
      &lt;dxmvvm:VisualStateService/&gt;
  &lt;/dxmvvm:Interaction.Behaviors&gt;
  &lt;dxb:BarManager&gt;
      &lt;DockPanel&gt;
          &lt;dxr:RibbonControl DockPanel.Dock="Top" RibbonStyle="Office2010" ToolbarShowMode="Hide"&gt;
              &lt;dxr:RibbonDefaultPageCategory&gt;
                  &lt;dxr:RibbonPage x:Name="ribbonPage_Main" Caption="View"&gt;
                      &lt;dxr:RibbonPageGroup x:Name="ribbonPageGroup_Main"&gt;
                          &lt;dxr:RibbonGalleryBarItem x:Name="ribbonGalleryBarItem_Theme"&gt;
                              &lt;dxmvvm:Interaction.Behaviors&gt;
                                  &lt;dxr:RibbonGalleryItemThemeSelectorBehavior/&gt;
                              &lt;/dxmvvm:Interaction.Behaviors&gt;
                          &lt;/dxr:RibbonGalleryBarItem&gt;
                      &lt;/dxr:RibbonPageGroup&gt;
                      &lt;dxr:RibbonPageGroup x:Name="My_Group" Caption="My Group"&gt;
                          &lt;dxb:BarButtonItem x:Name="NewProgramBtn" Content="New Program" Glyph="{dx:DXImage Image=Add_16x16.png}" LargeGlyph="{dx:DXImage Image=Add_32x32.png}" /&gt;
                          &lt;dxb:BarButtonItem x:Name="NewTaskBtn" Content="New Task" Glyph="{dx:DXImage Image=AddFile_16x16.png}" LargeGlyph="{dx:DXImage Image=AddItem_32x32.png}" /&gt;
                      &lt;/dxr:RibbonPageGroup&gt;
                  &lt;/dxr:RibbonPage&gt;
              &lt;/dxr:RibbonDefaultPageCategory&gt;
          &lt;/dxr:RibbonControl&gt;
          &lt;dxdo:DockLayoutManager FloatingMode="Desktop" ClosedPanelsBarVisibility="Never"&gt;
              &lt;dxdo:LayoutGroup Orientation="Horizontal"&gt;
                  &lt;dxdo:LayoutPanel x:Name="Navigation" Caption="Navigation" AllowClose="False" ItemWidth="200"&gt;
                      &lt;dx:DXTabControl&gt;
                          &lt;dx:DXTabItem Header="Tasks"&gt;
                              &lt;Grid Background="Transparent"&gt;
                                  &lt;dxg:TreeListControl AutoGenerateColumns="AddNew" EnableSmartColumnsGeneration="True" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="254" Width="151"&gt;
                                      &lt;dxg:TreeListControl.View&gt;
                                          &lt;dxg:TreeListView AllowPerPixelScrolling="True" ShowTotalSummary="True" Height="291" Margin="10, 10, 0, 0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /&gt;
                                      &lt;/dxg:TreeListControl.View&gt;
                                  &lt;/dxg:TreeListControl&gt;
                              &lt;/Grid&gt;
                          &lt;/dx:DXTabItem&gt;
                          &lt;dx:DXTabItem Header="Blocks"&gt;
                              &lt;Grid Background="Transparent"/&gt;
                          &lt;/dx:DXTabItem&gt;
                          &lt;dx:DXTabItem Header="Functions"/&gt;
                      &lt;/dx:DXTabControl&gt;
                  &lt;/dxdo:LayoutPanel&gt;
                  &lt;dxdo:DocumentGroup x:Name="Documents" DestroyOnClosingChildren="False" ClosingBehavior="HideToClosedPanelsCollection" 
                                      dxmvvm:UIRegion.Region="{x:Static common:Regions.Documents}"&gt;
                      &lt;dxdo:DocumentGroup.ItemStyle&gt;
                          &lt;Style TargetType="{x:Type dxdo:LayoutPanel}"&gt;
                              &lt;Setter Property="Caption" Value="{Binding Caption}"/&gt;
                              &lt;Setter Property="IsActive" Value="{Binding IsActive, Mode=TwoWay}"/&gt;
                          &lt;/Style&gt;
                      &lt;/dxdo:DocumentGroup.ItemStyle&gt;
                      &lt;dxdo:DocumentPanel Caption="Document"&gt;
                          &lt;dxdiag:DiagramControl SelectedStencils="BasicShapes, BasicFlowchartShapes"/&gt;
                      &lt;/dxdo:DocumentPanel&gt;
                  &lt;/dxdo:DocumentGroup&gt;
              &lt;/dxdo:LayoutGroup&gt;
          &lt;/dxdo:DockLayoutManager&gt;
      &lt;/DockPanel&gt;
  &lt;/dxb:BarManager&gt;
  </code></pre>
  
  <p></p>