title: Grid loses size when chaning DependencyProperty
body: <p>I have 2 Controls in WPF. A "main control" and a "chart control", which draws a barchart based on on DataSet.</p>
  
  <p>my main control initializes the chart control and binds the DatSet necessary for the drawing to its DependencyProperty. Since the DataSet i use has quite a few Tables, while I only need a single one for my chart, i recently created a new DataTable Property and forward the right Table from my DataSet to it.</p>
  
  <pre><code> &lt;Grid&gt;
  
              &lt;Grid.RowDefinitions&gt;
                  &lt;RowDefinition Height="*"/&gt;
                  &lt;RowDefinition Height="3"/&gt;
                  &lt;RowDefinition Height="*"/&gt;
                  &lt;RowDefinition Height="3"/&gt;
                  &lt;RowDefinition Height="*"/&gt;
                  &lt;RowDefinition Height="30"/&gt;
              &lt;/Grid.RowDefinitions&gt;
  &lt;Grid Grid.Row="2" Background="#f0f0f0"&gt;
                  &lt;c:ChartControl  TableData="{Binding ChartTable, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="Auto" Width="Auto" /&gt;
              &lt;/Grid&gt;
  [...]
  &lt;/Grid&gt;
  </code></pre>
  
  <p>I also changed my DependencyProperty in my ChartControl from DataSet to DataTable. Once my onDataPropertyChanged event fires, a method with following code will be called at the end:</p>
  
  <pre><code>if (TableData_ != null)
          {
              // previously DataTable ChartTable = dsData_.Tables[ChartTable].Copy();
  
              Grid gdChart = new Grid(); 
              gdChart.Width = MainGrid.ActualWidth;
              gdChart.Height = MainGrid.ActualHeight;
              foreach (DataRow row in TableData_.Rows)
              {
                 // draw Chart
              }
  MainGrid.Child = gdChart;
  }
  </code></pre>
  
  <p>That's all I changed. It worked previously, the DependencyProperty has the right value, but for reasons beyond my knowledge, <strong>the size of my MainGrid is always 0 now</strong>. I didn't change or move a single line in my code, but to change the Properties in both controls from DataSet to DataTable and delete the Table i previously copied in my ChartControl. How does another DependencyProperty affect the size?</p>
  
  <p>My ChartControl looks like this</p>
  
  <pre><code>&lt;UserControl [...]&gt;
       d:DesignHeight="300" d:DesignWidth="300" &gt;
      &lt;Viewbox x:Name="MainGrid" Height="Auto" Width="Auto" /&gt;
  &lt;/UserControl&gt;
  </code></pre>