title: Set background color depending on data-bound value
body: <p>I've seen some answers before but nothing really helped me out.</p>
  
  <p>I also have a class <code>DecideModel</code> (This will be a dataset retrieved from DB, but for purpose of this question, I have added an ObservableCollection) which contains</p>
  
  <pre><code>static DecideModel()
      {
          All = new ObservableCollection&lt;DecideModel&gt;
          {
              new DecideModel
              {
                  DatePerformed = new DateTime(2015, 4, 06),
                  Result = "Maybe"
              },
              new DecideModel
              {
                  DatePerformed = new DateTime(2015, 4, 05),
                  Result = "No"
              },
              new DecideModel
              {
                  DatePerformed = new DateTime(2015, 4, 04),
                  Result = "Yes"
              }
          };
      }
  
      public DateTime DatePerformed { set; get; }
  
      public string  Result { set; get; }
  
      public static IList&lt;DecideModel&gt; All { set; get; }
  }
  </code></pre>
  
  <p>In my XAML code I have</p>
  
  <pre><code>&lt;ContentPage.Resources&gt;
      &lt;ResourceDictionary&gt;
          &lt;Color x:Key="Maybe"&gt;#ffddbc21&lt;/Color&gt;
          &lt;Color x:Key="Yes"&gt;#3CB371&lt;/Color&gt;
          &lt;Color x:Key="No"&gt;#B22222&lt;/Color&gt;
          &lt;Color x:Key="Depends"&gt;#ffd78800&lt;/Color&gt;
      &lt;/ResourceDictionary&gt;
  &lt;/ContentPage.Resources&gt;
  
  &lt;Label Text="{Binding Result}" HorizontalOptions="FillAndExpand" BackgroundColor="{StaticResource {BindingSource Result}}" /&gt;
  </code></pre>
  
  <p>I am trying to dynamically set the background color of the label with respect to what result I have obtained from the Object.</p>
  
  <p>Please let me know if you have any idea on how to do it. I am looking for any useful option available.</p>