title: Associate the color of a TextColor of a Label in a DataTemplate to a Resource
body: <p>I have elements of a <code>List</code> inside a <code>StackLayout</code> in <code>Binding</code>. Inside the <code>DataTemplate</code> I have a <code>Label</code> with Gray <code>TextColor</code>. At the press of a button I would like the color of the <code>TextColor</code> to become the color of a <code>resource</code> I have within the application. How could I do?</p>
  <p><strong>c#</strong></p>
  <pre><code>public class Giorni
  {
     public string Color {get;set;}
  }
  
  List&lt;Giorni&gt; listgiorni = new List&lt;Giorni&gt;
  {
     new Giorni{},
  }
  
  
  BindableLayout,SetItemsSource(StackLayout, listgiorni);
  </code></pre>
  <p><strong>XAML:</strong></p>
  <pre><code>   &lt;Application.Resources&gt;
          &lt;Color x:Key=&quot;AppPrimaryColor&quot;&gt;#1976D2&lt;/Color&gt;
     &lt;/ApplicationResource&gt;
  </code></pre>
  <p>.....</p>
  <pre><code>   &lt;StackLayout&gt;
          &lt;BindableLayout.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                 &lt;Label TextColor=&quot;Gray&quot; Text=&quot;Hello&quot;/&gt;
              &lt;/DataTemplate&gt;
          &lt;/BindableLayout.ItemTemplate&gt;
      &lt;/StackLayout&gt;
  </code></pre>