title: How to retrieve sender in click handler from toolbartray or other control in wpf?
body: <p>XAML:</p>
  
  <pre><code>&lt;ToolBarTray Name="tlbTray" ButtonBase.Click="tlbTray_Click"&gt;
  
  &lt;ToolBar Name="tlbFile"&gt;
      &lt;Button Name="btnOpen"&gt;&lt;Image Source="images\folder.png" Stretch="None" /&gt;&lt;/Button&gt;
      &lt;Button Name="btnSave"&gt;&lt;Image Source="images\disk.png" Stretch="None" /&gt;&lt;/Button&gt;
  &lt;/ToolBar&gt;
  
  &lt;/ToolBarTray&gt;
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>private void tlbTray_Click(object sender, RoutedEventArgs e)
  {
    // How to get the name of the button or control that triggered the event
  }
  </code></pre>
  
  <p>As commented in the method. How do I get the name of the button or control that triggered the event. Or I'm handling this the wrong way? I just want to route all click events to that one method and decide what to do from there...</p>
  
  <p>Thanks! ;-)</p>