title: WPF: how can I have ListViewItems fit the window width and use TextEllipsis
body: <p>I'm currently working with a ListView. Its ListViewItems consist of a left-aligned TextBlock and a right-aligned Button:</p>
  
  <p><img src="https://i.stack.imgur.com/qAfBa.png" alt="The ListView in an uncomplicated state."></p>
  
  <p>Now, I'd like to have my Items <em>always</em> display the Button and shorten the TextBlock accordingly, so they don't need to display a ScrollBar:</p>
  
  <p><img src="https://i.stack.imgur.com/cPBm1.png" alt="The ListView&#39;s intended behavior."></p>
  
  <p>Unfortunately, right now that doesn't work:</p>
  
  <p><img src="https://i.stack.imgur.com/ZiIKx.png" alt="The ListView&#39;s current behavior."></p>
  
  <p>What can I do to make it work?
  Here's my example code:</p>
  
  <pre><code>&lt;Window x:Class="JansWpfTestUmgebung.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
      &lt;ListView x:Name="AllItemsList"
                HorizontalContentAlignment="Stretch"
                HorizontalAlignment="Stretch"&gt;
          &lt;ListViewItem&gt;
          &lt;Grid&gt;
              &lt;Grid.ColumnDefinitions&gt;
                  &lt;ColumnDefinition Width="*" /&gt;
                  &lt;ColumnDefinition Width="Auto" /&gt;
              &lt;/Grid.ColumnDefinitions&gt;
              &lt;TextBlock Grid.Column="0"
                         TextTrimming="CharacterEllipsis" 
                         Text="Item 1 with a very long description"/&gt;
              &lt;Button Grid.Column="1"
                      Content="Modify" /&gt;
          &lt;/Grid&gt;
      &lt;/ListViewItem&gt;
          &lt;ListViewItem&gt;Item 2&lt;/ListViewItem&gt;
          &lt;ListViewItem&gt;Item 3&lt;/ListViewItem&gt;
      &lt;/ListView&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>Thanks for any hints! :-)</p>