private void DeleteDatatype_OnClick(object sender, RoutedEventArgs e) { Datatype selectedDatatype = ((FrameworkElement)sender).DataContext as Datatype; _projectEditorViewModel.DeleteDatatype(selectedDatatype); }