title: Binding listbox maxHeight to parent actual
body: <p>So I am having some trouble getting the binding of a <code>lisbox</code> <code>height</code> to work. I have a user control that holds a <code>listbox</code>, this box is dynamically populated on the fly but it seems that if too many items are added it extends past the boundaries of the parent objects and refuses to stop and use the scoll bar... </p>
  
  <pre><code>   &lt;UserControl x:Class="TransaltionModule.Views.NoteView"
           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" 
           mc:Ignorable="d"&gt;
  &lt;Grid&gt;
      &lt;ListBox ItemsSource="{Binding noteList}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Auto" &gt;
          &lt;ListBox.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;Grid&gt;
                      &lt;Grid.ColumnDefinitions&gt;
                          &lt;ColumnDefinition Width="1*"/&gt;
                          &lt;ColumnDefinition Width="1*"/&gt;
                      &lt;/Grid.ColumnDefinitions&gt;
                      &lt;Grid.RowDefinitions&gt;
                          &lt;RowDefinition Height="1*"/&gt;
                          &lt;RowDefinition Height="5*"/&gt;
                      &lt;/Grid.RowDefinitions&gt;
                      &lt;StackPanel Orientation="Horizontal" Grid.Column="0"&gt;
                          &lt;TextBlock Text="Type :" VerticalAlignment="Center" FontSize="14" Width="65"/&gt;
                          &lt;TextBox Text="{Binding noteType}" Width="auto" IsEnabled="False" VerticalAlignment="Center" FontSize="14"/&gt;
                      &lt;/StackPanel&gt;
                      &lt;StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right"&gt;
                          &lt;TextBlock Text="Date :" VerticalAlignment="Center" FontSize="14" Width="65"/&gt;
                          &lt;TextBox Text="{Binding timeStamp}" Width="auto" IsEnabled="False" VerticalAlignment="Center" FontSize="14"/&gt;
                      &lt;/StackPanel&gt;
                      &lt;TextBlock Grid.Row="1" Text="{Binding text}" Grid.ColumnSpan="2"/&gt;
                  &lt;/Grid&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListBox.ItemTemplate&gt;
      &lt;/ListBox&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>If i hardcode the <code>maxheight</code> property everything works as intended, but with the multiple display resolutions I will be working against that is not a solution I can use. Can anyone recommend a fix</p>