title: How is it suggested to inherit from an implicit style in Xamarin.Forms XAML?
body: <p>I am having some issues inheriting from an implicit style defined in an Application ResourceDictionary. I have tried a couple of different approaches, but each has been unsuccessful in one form or another.</p>
  
  <h1>Attempt 1: Inherit from implicit style</h1>
  
  <h3>Application ResourceDictionary</h3>
  
  <pre><code>&lt;Style TargetType="Button"&gt;
      &lt;Setter Property="BackgroundColor" Value="#1386F1" /&gt;
      &lt;Setter Property="TextColor" Value="White" /&gt;
      &lt;Setter Property="FontAttributes" Value="Bold" /&gt;
      &lt;Setter Property="HeightRequest"&gt;
        &lt;OnPlatform x:TypeArguments="x:Double" iOS="30" Android="50" /&gt;
      &lt;/Setter&gt;
      &lt;Style.Triggers&gt;
        &lt;Trigger TargetType="Button" Property="IsEnabled" Value="False"&gt;
          &lt;Setter Property="BackgroundColor"&gt;
            &lt;OnPlatform x:TypeArguments="Color" iOS="#E8E8E8" /&gt;
          &lt;/Setter&gt;
        &lt;/Trigger&gt;
      &lt;/Style.Triggers&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <h3>Page ResourceDictionary</h3>
  
  <pre><code>&lt;Style x:Key="LoginButtonStyle" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}"&gt;
      &lt;Setter Property="BackgroundColor" Value="#024886" /&gt;
      &lt;Setter Property="Margin"&gt;
        &lt;OnPlatform x:TypeArguments="Thickness" iOS="0,5" /&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <h3>Page Control</h3>
  
  <pre><code>&lt;Button Style="{StaticResource LoginButtonStyle}" /&gt;
  </code></pre>
  
  <h3>Result</h3>
  
  <p>Throws exception "StaticResource not found for key {x:Type Button}". This is how I remember doing it in WPF, but I'm assuming this isn't supported in Xamarin XAML.</p>
  
  <h1>Attempt 2: Inherit from common explicit style</h1>
  
  <h3>Application ResourceDictionary</h3>
  
  <pre><code>&lt;Style x:Key="DefaultButtonStyle" TargetType="Button"&gt;
      &lt;!-- Same as Attempt 1 --&gt;
  &lt;/Style&gt;
  &lt;!-- This implicit style causes issues with the inheritence of the Trigger in the above explicit style. When it's commented out, everything works fine. --&gt;
  &lt;Style TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}" /&gt;
  </code></pre>
  
  <h3>Page ResourceDictionary</h3>
  
  <pre><code>&lt;Style x:Key="LoginButtonStyle" TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}"&gt;
      &lt;!-- Same as Attempt 1 --&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <h3>Page Control</h3>
  
  <pre><code>&lt;!-- Same as Attempt 1 --&gt;
  </code></pre>
  
  <h3>Result</h3>
  
  <p>Everything works except for the Trigger. However, when I remove the implicit style the Trigger magically starts working again. I'd rather not have to specify the explicit style on every Button, though. I believe this is just a bug, but I wanted to make sure before I take the time to prepare a bug report.</p>
  
  <p>Any ideas?</p>
  
  <p><a href="http://forums.xamarin.com/discussion/74481/how-is-it-suggested-to-inherit-from-an-implicit-style" rel="noreferrer">Question in Xamarin Forums</a></p>