title: How to set color with dependencyproperty?
body: <p>This might be a stupid question, but how to set the color property of a usercontrol? Because in XAML the color is just a text field how do I have to convert the value so that I can set the brush correctly </p>
  
  <p><code>&lt;MyUserControl LabelColour="#FF747474" /&gt; 
  &lt;MyUserControl LabelColour="Red"/&gt;</code></p>
  
  <p>This is how far I got. The value comes in as the text but what is the next step to convert it to a brush?</p>
  
  <pre><code>private static DependencyProperty LabelColourProperty
          = DependencyProperty.Register("LabelColour", typeof(object), typeof(MyUserControl), new PropertyMetadata(null));
  
      public object LabelColour
      {
          get { return GetValue(LabelColourProperty); }
          set { SetValue(LabelColourProperty, value); LabelGrid.Background = (Brush)value; }
      }
  </code></pre>