title: Is there a way I can access a static resource in my C# code?
body: <p>In my App.XAML I have this:</p>
  
  <pre><code>&lt;Application xmlns:converters="clr-namespace:Japanese" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Japanese.App"&gt;
  &lt;Application.Resources&gt;
          &lt;Color x:Key="TextColor1"&gt;#123456&lt;/Color&gt;
  </code></pre>
  
  <p>I can access this value in XAML like this:</p>
  
  <pre><code>&lt;Style TargetType="Label"&gt;
          &lt;Setter Property="TextColor" Value="{StaticResource TextColor1}" /&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>But is there also a way that I can access this in my back end C#</p>
  
  <pre><code>vm.C1BtnLabelTextColor = phrase.C1 == true ? Color.FromHex("#123456") : Color.FromHex("#0000FF");
  </code></pre>
  
  <p>For example here I would like to replace: </p>
  
  <pre><code>Color.FromHex("#123456")
  </code></pre>
  
  <p>with the value of the StaticResource</p>