title: Specifying RowDefinition.Height in code
body: <p>When you're creating a Grid in xaml you can define the RowDefinitions as such</p>
  
  <pre><code>&lt;Grid&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="*"/&gt;
          &lt;RowDefinition Height="Auto"/&gt;
      &lt;/Grid.RowDefinitions&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>I have a need to do the same thing in code. I know I can write</p>
  
  <pre><code>RowDefinition row = new RowDefinition();
  row.Height = new GridLength(1.0, GridUnitType.Star);
  </code></pre>
  
  <p>but that doesn't help me much since I've got a string coming in. I could probably create my own "string to GridLength" converter but this doesn't feel right since it works ever so smooth from xaml. Of course, I've tried the following but it doesn't work</p>
  
  <pre><code>row.Height = new GridLength("*");
  </code></pre>
  
  <p>What am I missing here?</p>