title: Xamarn.Forms Style or StyleClass?
body: <p>I've been working an a Xamarin.Forms application and I noticed that I have two options for applying styles. I can create a Style with a "class" property and use it with an elements "StyleClass" property like so:</p>
  
  <pre><code>    &lt;Style Class="GenericButton" TargetType="Button"&gt;
          &lt;Setter Property="BackgroundColor" Value="Orange"/&gt;
      &lt;/Style&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>    &lt;Button StyleClass="GenericButton" Command="{Binding LoginCommand}" Text="Login" /&gt;
  </code></pre>
  
  <p>Or, I can write a Style with "x:Key" and use it with the "Style" property set to a static resource:</p>
  
  <pre><code>    &lt;Style x:Key="GenericBut" TargetType="Button"&gt;
          &lt;Setter Property="BackgroundColor" Value="Azure"/&gt;
      &lt;/Style&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>&lt;Button Style="{StaticResource GenericBut}" Command="{Binding LoginCommand}" Text="Login" /&gt;
  </code></pre>
  
  <p>Either one seems to work, but I don't know which to use in general, and I cannot find the proper documentation on their purposes. StyleClass is an IList and I believe it applies styles like CSS, which seems useful, but I'm wondering if there would be unforeseen consequences of using it all the time.</p>
  
  <p>Thanks</p>