title: WPF ColumnDefinition Auto Width MinWidth Binding
body: <p>As I was writing this I found a solution which I will explain below, but for the sake of an academic exercise I was wondering why my original solution didn't work.</p>
  
  <p>I was trying to setup a 3 column <code>&lt;Grid&gt;</code> where the left and right hand columns would auto-size to their content but both have the same width, so the smaller column would expand to match the bigger column. This is what I tried, which seems like it should work:</p>
  
  <pre><code>        &lt;Grid&gt;
              &lt;Grid.ColumnDefinitions&gt;
                  &lt;ColumnDefinition Name="FlagColumn" Width="Auto" MinWidth="{Binding ActualWidth, ElementName=NumberColumn}"/&gt;
                  &lt;ColumnDefinition Width="*"/&gt;
                  &lt;ColumnDefinition Name="NumberColumn" Width="Auto" MinWidth="{Binding ActualWidth, ElementName=FlagColumn}"/&gt;
              &lt;/Grid.ColumnDefinitions&gt;                
  
              &lt;TextBlock Grid.Column="0" Text="AAAA" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
              &lt;TextBlock Grid.Column="1" Text="BBBBBBBBBBBBB" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
              &lt;TextBlock Grid.Column="2" Text="CCCCCCC" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
          &lt;/Grid&gt;
  </code></pre>
  
  <p>This resulted in the columns auto-sizing but seemingly ignoring the MinWidth binding and just auto sizing to their own content independently.</p>
  
  <p>Just FYI, this is what I ended up doing to make it work:</p>
  
  <pre><code>        &lt;Grid Grid.IsSharedSizeScope="True"&gt;
              &lt;Grid.ColumnDefinitions&gt;
                  &lt;ColumnDefinition Width="Auto" SharedSizeGroup="Corner"/&gt;
                  &lt;ColumnDefinition Width="*"/&gt;
                  &lt;ColumnDefinition Width="Auto" SharedSizeGroup="Corner"/&gt;
              &lt;/Grid.ColumnDefinitions&gt;                
  
              &lt;TextBlock Grid.Column="0" Text="AAAA" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
              &lt;TextBlock Grid.Column="1" Text="BBBBBBBBBBBBB" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
              &lt;TextBlock Grid.Column="2" Text="CCCCCCC" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
          &lt;/Grid&gt;
  </code></pre>