title: WPF Storyboard requires TargetName
body: <p>I have popup "Now playing" window in my app, and now I want to apply any cool effect to its show/hide. I don't want to create/dispose window each time I need to show/hide it, so I suppose I can't use <code>Window.Triggers</code>. I created sample storyboard and invoke it from code-behind; So it instantly fall into exception <code>No target was specified for 'System.Windows.Media.Animation.DoubleAnimation</code>. I found <a href="https://stackoverflow.com/questions/910488/wpf-storyboard-beginner-problem">this answer</a> and added <code>Storyboard.TargetName</code> attribute.</p>
  
  <pre><code>    &lt;Window.Resources&gt;
          &lt;Storyboard x:Key="OpenAnimation"&gt;
              &lt;DoubleAnimation Storyboard.TargetName="NowPlaying" Storyboard.TargetProperty="(Window.Opacity)" Duration="0:0:5" From="0" To="1" /&gt;
          &lt;/Storyboard&gt;
      &lt;/Window.Resources&gt;
  </code></pre>
  
  <p>But it throws another exception: <code>Can't find name "NowPlaying" in namespace "VKPlaylist.GUI.NowPlaying".</code> But window code-behind class name IS <code>NowPlaying</code>. I also tried full name with namespace and it didn't change things.</p>
  
  <p>How should I point proper name in this attribute? Is there any "magic" keyword like "this" so storyboard will know where to apply animation? I can't assign name attribute to window in XAML (and probably must not). It looks like dude in answer above easily solved his issue just by adding this attribute. What I am missing?</p>