title: Custom UserControl Property used by child element
body: <p>I'm trying to get some WPF concepts down, so I've put together a simple example of what I'm trying to do. I would like to set a custom property of a user control, and have it be used by an element within the control.</p>
  
  <p>I've been researching and experimenting, but I'm not fully understanding everything here. Any help would be appreciated.</p>
  
  <p>The user control for this example is a simple square with a circle inside of it:</p>
  
  <pre><code>&lt;UserControl x:Class="CircleInSquare"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="100" Height="100" &gt;
      &lt;Grid Background="#000000"&gt;
          &lt;Ellipse Name="Circle"
                   Margin="10"
                   Fill="?????????"
                   &gt;
          &lt;/Ellipse&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>The VB Code Behind it:</p>
  
  <pre><code>Partial Public Class CircleInSquare
  
      Private _CircleColor As Color
  
      Public Property CircleColor() As Color
          Get
              Return _CircleColor
          End Get
          Set(ByVal value As Color)
              _CircleColor = value
          End Set
      End Property
  
  End Class
  </code></pre>
  
  <p>When I use this user control, how can I apply a CircleColor to the control, and have it be shown as the Ellipse's fill color? Even better... can I give it a default color that shows up in the VS2008 Designer?</p>
  
  <p>So... if I place one of these into my window XAML like this:</p>
  
  <pre><code>&lt;app:CircleInSquare CircleColor="Blue" /&gt;
  </code></pre>
  
  <p>I would like the circle to display as Blue (or any other color I choose for that instance)</p>