XAML:
<ToolBarTray Name='tlbTray' ButtonBase.Click='tlbTray_Click'> <ToolBar Name='tlbFile'> <Button Name='btnOpen'><Image Source='images\folder.png' Stretch='None' /></Button> <Button Name='btnSave'><Image Source='images\disk.png' Stretch='None' /></Button> </ToolBar> </ToolBarTray>
Code:
private void tlbTray_Click(object sender, RoutedEventArgs e) { // How to get the name of the button or control that triggered the event }
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…
Thanks! 😉
Owkay, I found it!