title: How to Override FluentAvalonia Styles
body: <p>Using FluentAvalonia styles for Avalonia in .NET.</p>
  <p>Let's say I want to edit the default style to set the button background to AccentColor3 and on hover AccentColor2. How do I do that?</p>
  <p>First, setting this style works; but setting <code>ThemeAccentBrush3</code> doesn't. How do I set set the accent in a way that works for both dark and light themes?</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;Style Selector=&quot;Button&quot;&gt;
      &lt;Setter Property=&quot;Background&quot; Value=&quot;{DynamicResource SystemAccentColorDark3}&quot; /&gt;
  &lt;/Style&gt;
  </code></pre>
  <p>Second, I figured that the best approach is to create an Avalonia Dictionary file</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;ResourceDictionary xmlns=&quot;https://github.com/avaloniaui&quot;
                      xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;&gt;
      &lt;StaticResource x:Key=&quot;ButtonBackground&quot; ResourceKey=&quot;SystemAccentColorDark3&quot; /&gt;
      &lt;StaticResource x:Key=&quot;ButtonBackgroundPointerOver&quot; ResourceKey=&quot;SystemAccentColorDark2&quot; /&gt;
  &lt;/ResourceDictionary&gt;
  </code></pre>
  <p>And then reference in App.axaml</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;Application.Resources&gt;
      &lt;ResourceDictionary&gt;
          &lt;ResourceDictionary.MergedDictionaries&gt;
              &lt;ResourceInclude Source='avares://Common.Avalonia.App/Styles/DarkResources.axaml'/&gt;
          &lt;/ResourceDictionary.MergedDictionaries&gt;
      &lt;/ResourceDictionary&gt;
  &lt;/Application.Resources&gt;
  </code></pre>
  <p>However, styles are loaded further down, and thus don't exist yet.</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;Application.Styles&gt;
      &lt;sty:FluentAvaloniaTheme /&gt;
  
  </code></pre>
  <p>Thus...</p>
  <pre><code>Static resource 'SystemAccentColorDark3' not found.
  </code></pre>
  <p>What's the cleanest solution?</p>