title: What is the meaning of x:Name in xaml (WPF) and its use with Storyboard
body: <pre><code>&lt;Border Name="ItemBorder" Margin="5 5 0 5" BorderBrush="Black" BorderThickness="1" Height="75" Width="75"&gt;
    &lt;Border.Background&gt;
      &lt;SolidColorBrush x:Name="ItemBorderBrush" Color="LightBlue"/&gt;
    &lt;/Border.Background&gt;
    &lt;ContentPresenter/&gt;
  &lt;/Border&gt;
  &lt;ControlTemplate.Triggers&gt;
    &lt;EventTrigger RoutedEvent="someEvent"&gt;
      &lt;BeginStoryboard&gt;
        &lt;Storyboard TargetName="ItemBorderBrush" TargetProperty="Color" Duration="0:0:1" &gt;
        &lt;!--Storyboard TargetName="ItemBorder" TargetProperty="Background.Color" Duration="0:0:1"&gt; --&gt;
           &lt;ColorAnimation To="White"/&gt;
        &lt;/Storyboard&gt;
      &lt;/BeginStoryboard&gt;
    &lt;/EventTrigger&gt;
  &lt;/ControlTemplate.Triggers&gt;
  </code></pre>
  
  <p>I'll try to explain my question clearly. The Storyboard Target name, when it is "ItemBorder" (the commented out line) works intermittently. Sometimes I get an error that the name "ItemBorder" cannot be found in the scope.</p>
  
  <p>I decided to follow a style from an MSDN example of this, and change the color property directly on the brush, instead of having the target of the storyboard be the border, and changing the color of the border's brush by property (the commented out line).  This seems to work. </p>
  
  <p>However, <code>Name="ItemBorderBrush"</code> does not compile because <code>Name</code> is not a property of <code>SolidColorBrush</code> so I use <code>x:Name="ItemBorderBrush"</code> Both <code>Name</code> and <code>x:Name</code> are accepted for the Border. Why is this?</p>
  
  <p>What does the <code>x:</code> mean (how is <code>x:Name</code> different from <code>Name</code>), and why would having the <code>Name</code> property of border only work with the storyboard sometimes?</p>