title: Using DynamicResource Style and DataTrigger for button in XAML
body: <p>I am using predefined style like <code>Style="{DynamicResource SquareButtonStyle}"</code> </p>
  
  <p>that cannot be modified and I need to enable/disable a <code>Button</code> via <code>DataTrigger</code>.</p>
  
  <p>It seems like is impossible to do?  </p>
  
  <blockquote>
    <p>The error is:  The property 'Style' is set more than once.</p>
  </blockquote>
  
  <pre><code>&lt;Button Content="Guardar" Width="100"  Style="{DynamicResource SquareButtonStyle}" Name="SaveTemplateATM" Click="SaveTemplateATM_Click"&gt;
    &lt;Button.Style&gt;
          &lt;Style TargetType="{x:Type Button}"&gt;
                  &lt;Style.Triggers&gt;
                         &lt;DataTrigger Binding="{Binding Text.Length, ElementName=UserName, UpdateSourceTrigger=PropertyChanged}" Value="0"&gt;
                             &lt;Setter Property="IsEnabled" Value="False"/&gt;
                         &lt;/DataTrigger&gt;                                           
               &lt;/Style.Triggers&gt;
          &lt;/Style&gt;
    &lt;/Button.Style&gt;
  &lt;/Button&gt;
  </code></pre>