title: DataGrid Column Visibility is not working
body: <p>I am trying to control the visibility of a DataGridTemplateColumn using IsVisible Property inside the ViewModel.
  Here is the xaml code</p>
  
  <pre><code>&lt;DataGrid&gt;
      &lt;DataGrid.Resources&gt;
           &lt;local:BindingProxy x:Key="proxy" Data="{Binding}"/&gt;
      &lt;/DataGrid.Resources&gt;
      &lt;DataGrid.Columns&gt;
          &lt;DataGridTemplateColumn Width="32" IsReadOnly="True"
                              Visibility="{Binding  Path=Data.IsVisible,TargetNullValue=True,Source={StaticResource Proxy},Converter={StaticResource BoolToVisibilityConverter}}"   CellTemplate="{StaticResource RemoveButtonTemplate}"&gt;
          &lt;/DataGridTemplateColumn&gt;
      &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  
  <p>Here is my binding proxy</p>
  
  <pre><code>public class BindingProxy : Freezable
  {
      #region Overrides of Freezable
  
      protected override Freezable CreateInstanceCore()
      {
          return new BindingProxy();
      }
  
      #endregion
  
      public object Data
      {
          get { return (object)GetValue(DataProperty); }
          set { SetValue(DataProperty, value); }
      }
  
      public static readonly DependencyProperty DataProperty =
          DependencyProperty.Register("Data", typeof(object),
                                       typeof(BindingProxy));
  }
  </code></pre>
  
  <p>Here is the Viewmodel property</p>
  
  <pre><code>public bool IsVisible
          {
              get { return true; }           
          }
  </code></pre>
  
  <p>Every first time when i load the grid the DataGridTemplateColumn is always hidden. Please advice if i am doing some thing wrong.</p>
  
  <p>Strange thing is that it works perfectly if i use FrozenColumnCount in xaml. </p>