title: Set Dimensions of RelativePanel's Children proportional to that of parent view
body: <p>I am new to Windows Runtime programming and decided to get stuck in ahead of the release of Windows 10.</p>
  
  <p>I am trying to design an adaptive page UI that looks something like as follows,
  <img src="https://i.stack.imgur.com/1YILP.png" alt="Desktop view">
  There is header "stuff" at the top and beneath it I want two columns, each with a textblock header and below it, a listview.  The listview could be arbitraryheight and so the parent of the two blocks should, I think, be a scrollviewer.</p>
  
  <p>On mobile however, this UI won't work as the screen is far to narrow, and so I would like to use a visualstate to rearrange the page so it looks as follows,
  <img src="https://i.stack.imgur.com/qe43P.png" alt="Mobile view"></p>
  
  <p>As you can see, the need for a scrollviewer is apparent to wrap this section.  the "Other stuff" at the top should stay fixed however so it can be seen all the time.</p>
  
  <p>I have tried a number of approaches to achieve this but haven't been able to manage it.  What I currently have is this:</p>
  
  <pre><code>//.... Other Stuff ......
  &lt;ScrollViewer x:Name="SummaryScrollViewer" Grid.Row="2" HorizontalScrollBarVisibility="Disabled"
                HorizontalScrollMode="Disabled" VerticalScrollMode="Auto" VerticalScrollBarVisibility="Auto" HorizontalContentAlignment="Center"&gt;
          &lt;RelativePanel x:Name="SummaryRelativePanel"&gt;
              &lt;Grid x:Name="lCol" Width="{Binding ActualWidth, ElementName=SummaryRelativePanel}"&gt;
                  &lt;Grid.RowDefinitions&gt;
                      &lt;RowDefinition Height="Auto"/&gt;
                      &lt;RowDefinition Height="Auto"/&gt;
                  &lt;/Grid.RowDefinitions&gt;
                  &lt;Grid.ColumnDefinitions&gt;
                      &lt;ColumnDefinition Width="*"/&gt;
                  &lt;/Grid.ColumnDefinitions&gt;
                  &lt;TextBlock x:Name="lcolHead" Grid.Row="0" Text="TextBlock:"/&gt;
                  &lt;ListView x:Name="lcolList" Grid.Row="1"&gt;
                  &lt;/ListView&gt;
              &lt;/Grid&gt;
              &lt;StackPanel x:Name="rCol" Orientation="Vertical" RelativePanel.RightOf="lCol"&gt;
                  &lt;TextBlock x:Name="rcolHead" Text="TextBlock:"/&gt;
                  &lt;ListView x:Name="rcolList" Height="Auto"&gt;
                  &lt;/ListView&gt;
              &lt;/StackPanel&gt;
          &lt;/RelativePanel&gt;
      &lt;/ScrollViewer&gt;
  </code></pre>
  
  <p>As you can see, I have tried to make the contents of each column both a stackpanel, and a grid, but I haven't been able to set the width of them to be, in "desktop view", half that of the containing relative panel, which should fill the full width of the screen, and in "mobile view" they should fill the full width of the parent.</p>
  
  <p>I have found answers on how to bind the width to the ActualWidth property of the parent element as can be seen in the snippet, and this works, but I can't seem to make the two columns fill half of the parent each.</p>
  
  <p>I wanted to use a RelativePanel so I can use the viewstate to change the properties of the right hand column to be either RightOf="LeftCol" or Below="LeftCol", and the widths should then be updated too to fill the width required.</p>
  
  <p>Using a grid Should also be possible, define a 4x4 grid where in desktop the  bottom two are collapse, or in mobile the right two are collapsed, but I was under the impression that this is the precise usecase the relativepanel was intended for.</p>
  
  <p>In all examples of relativepanel they use relativepanel to move programmer defined with/height elements such as rectangles <a href="https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.relativepanel.aspx" rel="nofollow noreferrer">RelativePanel class</a>.</p>
  
  <p>It would also be possible to manually set ActualWidth of each column programatically from the code-behind but I don't know how to query which visual state the app/page is currently in to figure out how wide and where each column should be.</p>
  
  <p>Any help and advice on what the "best" way to achieve such a thing would be would be greatly appreciated.</p>