How do you get the button name/tag when the event button.click occurs?
问题 I'm making buttons programatically and adding them to a stack panel so the buttons change each time the user navigates to the page. I'm trying to do something like this where when I click the created button it'll grab the tag of the button and go to the correct page. However, I can't access the button elements using RoutedEventHandler. Here's the code: foreach (item in list) { Button newBtn = new Button(); newBtn.Content = "Button Text"; newBtn.Tag = item.Tag; newBtn.Name = item.Name; newBtn