title: Setting Grid RowDefinitions/ColumnDefinitions properties in a style
body: <p>Suppose that you have 2 or more grids that share the same structure (Rows/Columns count and properties are equal).</p>
  
  <p>Is it possible to create a <strong>Style</strong> and set <strong>RowDefinitions</strong>/<strong>ColumnDefinitions</strong>?</p>
  
  <p>I have tried that. But I get this exception when the application tries to parse the xaml:</p>
  
  <blockquote>
    <p>Xamarin.Forms.Xaml.XamlParseException: Position 14:9. Property Value is null or is not IEnumerable</p>
  </blockquote>
  
  <p>My Source code:</p>
  
  <pre><code>&lt;StackLayout&gt;
      &lt;StackLayout.Resources&gt;
          &lt;ResourceDictionary&gt;
              &lt;Style TargetType="Grid"&gt;
                  &lt;Setter Property="RowDefinitions"&gt;
                      &lt;Setter.Value&gt;
                          &lt;RowDefinition /&gt;
                          &lt;RowDefinition /&gt;
                      &lt;/Setter.Value&gt;
                  &lt;/Setter&gt;
              &lt;/Style&gt;
          &lt;/ResourceDictionary&gt;
      &lt;/StackLayout.Resources&gt;
  
      &lt;Grid&gt;
          &lt;Label Grid.Row="0" Text="(Grid #1) Row #1" /&gt;
          &lt;Label Grid.Row="1" Text="(Grid #1) Row #2" /&gt;
      &lt;/Grid&gt;
  
      &lt;Grid&gt;
          &lt;Label Grid.Row="0" Text="(Grid #2) Row #1" /&gt;
          &lt;Label Grid.Row="1" Text="(Grid #2) Row #2" /&gt;
      &lt;/Grid&gt;
  
      &lt;Grid&gt;
          &lt;Label Grid.Row="0" Text="(Grid #3) Row #1" /&gt;
          &lt;Label Grid.Row="1" Text="(Grid #3) Row #2" /&gt;
      &lt;/Grid&gt;
  &lt;/StackLayout&gt;
  </code></pre>
  
  <p><strong>Position 14:9</strong> in the exception refers to the first <code>&lt;RowDefinition /&gt;</code> tag.</p>