Get the ListBox row object from a button that is on the DataTemplate
问题 I have a ListBox with a DataTemplate . The template has a Button on it. When the Button is clicked I want to do some logic with the object that is each row (in this case an object called WorkItemTypeMappings ). In the OnClick how can I go from the Button ( object sender ) to the object that is row that the button is on? Here is the XAML of my ListBox : <ListBox ItemsSource="{Binding Source={StaticResource WorkItemTypeMappingsCollectionView}}" HorizontalContentAlignment="Stretch" ScrollViewer