I have a WPF application that has a list populated with match elements. How to make a button (contained inside an element) actually select an element so that I can extract the value?
Here is my code: neither works, since pressing a button does not actually select an item
private void LayButton_Click(object sender, RoutedEventArgs e) { var x = (Market)ListBoxSelectedMarket.SelectedItem; var y = (sender as ListBoxItem); }
thanks
button click wpf listbox listboxitem
Chris
source share