private void ButtonDelete_Click(object sender, RoutedEventArgs e) { // Get the element on which the button was pressed Button button = e.OriginalSource as Button; ExcerciseDisplay selectedExcercise = (e.OriginalSource as Button).DataContext as ExcerciseDisplay; DisplayDeleteDataDialog(selectedExcercise); }
private void ButtonEdit_Click(object sender, RoutedEventArgs e) { ExcerciseDisplay excerciseDisplayTmp = (e.OriginalSource as Button).DataContext as ExcerciseDisplay; application.EditExcercise(excerciseDisplayTmp.GetExcercise()); }