title: How to set WPF's Grid.RowDefinitions via Style
body: <p>I'm using a couple of <code>Grid</code>s to format multiple <code>GridViewColumn.CellTemplate</code>s:</p>
  
  <pre><code>&lt;ListView SharedSizeScope="true"&gt;
    &lt;ListView.View&gt;
      &lt;GridView&gt;
        &lt;GridViewColumn&gt;
          &lt;GridViewColumn.CellTemplate&gt;
            &lt;DataTemplate&gt;
              &lt;Grid&gt;
                &lt;Grid.RowDefinitions&gt;
                  &lt;RowDefinition SharedSizeGroup="foo" /&gt;
                  &lt;!-- ... --&gt;
  </code></pre>
  
  <p>I tried to extract the <code>RowDefinition</code>s (which are the same for all columns) into a <code>Style</code>:</p>
  
  <pre><code>&lt;Style TargetType="{x:Type Grid}"&gt;
    &lt;Setter Property="RowDefinitions"&gt;
      &lt;Setter.Value&gt;
        &lt;RowDefinition SharedSizeGroup="foo" /&gt;
        &lt;!-- ... --&gt;
  </code></pre>
  
  <p>But the compiler complains:</p>
  
  <blockquote>
    <p>Error: The Property Setter
    'RowDefinitions' cannot be set because
    it does not have an accessible set
    accessor.</p>
  </blockquote>
  
  <p>Which is kind of obvious, but not very helpful.</p>
  
  <p>How could I avoid specifying the row definitions multiple times (see also <a href="http://c2.com/cgi/wiki?DontRepeatYourself" rel="noreferrer">Don't Repeat Yourself</a>) short of coding up a custom derivation of the <code>Grid</code>?</p>