title: wpf canvas get child name
body: <p>I got a canvas with some children. </p>
  
  <pre><code>&lt;Canvas Name="Canvas" MouseDown="getElements"&gt;
      &lt;Rectangle  Height="200" Width="200" Name="Element1"/&gt;
      &lt;Rectangle  Height="200" Width="200" Name="Element2"/&gt;
  &lt;/Canvas&gt;
  </code></pre>
  
  <p>and by clicking on a canvas element I want to get the name of the clicked element with something like this:  </p>
  
  <pre><code>public void getElements(object Sender, EventArgs e)
  {
       DependencyObject dpobj = Sender as DependencyObject;
       string name = dpobj.GetValue(FrameworkContentElement.NameProperty) as string;
  
       Console.WriteLine("Element Clicked: " + name);
  }
  </code></pre>
  
  <p>but I only get the name of the canvas. can anybody help me to get the names of the clicked elements?</p>
  
  <p>thanks in advance!</p>