title: How to resize WPF Listview proportionally?
body: <p>I have a little bit problem with resizing Listview control. I intend to make it resize proportionally, according to the actual size of the window. </p>
  
  <p>For initial size of Listview, it's 300 X 600 (width X height) in pixels. And I also set its <strong>maxHeight</strong> to 750, but its width stays the same, i.e. 300. </p>
  
  <p>Also, in Wondow's properties, I have changed <strong>SizeToContent</strong> property to <strong>WidthAndHeight</strong>, as some of the threads suggest by doing so you let system decide the proper size of the control after window's been resized. </p>
  
  <p>However, it's not yet working. So I am here to ask for help. Thanks. </p>
  
  <p>P.S. is there anyway we can set percentage value for width and height in WPF? That'd be a lot easier if I am allowed to use percentage, like height = 80%. </p>
  
  <p>EDIT:</p>
  
  <p>To make it clearer, here is the general code structure in xaml</p>
  
  <pre><code>&lt;Grid Height="Auto"&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="Auto" /&gt;
              &lt;RowDefinition Height="50" /&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="Auto" /&gt;
          &lt;/Grid.ColumnDefinitions&gt;
      &lt;StackPanel Grid.Row="0" Orientation="Horizontal" Height="Auto" Margin="0"&gt;
          &lt;ListView /&gt;
      &lt;/StackPanel&gt;
      &lt;StackPanel Grid.Row="1" Orientation="Horizontal" Height="Auto" Margin="0"&gt;
          &lt;Label /&gt;
          &lt;Button /&gt; 
      &lt;/StackPanel&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>As you can see, I am currently using 2 stack panels and put them in separate rows. But Listview still can't resize proportionally even if I change  to . </p>