diff --git a/src/Views/Histories.axaml.cs b/src/Views/Histories.axaml.cs index 85092b64..976d46cb 100644 --- a/src/Views/Histories.axaml.cs +++ b/src/Views/Histories.axaml.cs @@ -730,9 +730,12 @@ namespace SourceGit.Views private void OnCommitListDoubleTapped(object sender, TappedEventArgs e) { - if (DataContext is ViewModels.Histories histories && sender is ListBox { SelectedItems: { Count: 1 } selected }) + if (DataContext is ViewModels.Histories histories && sender is ListBox { SelectedItems: { Count: 1 } } listBox) { - histories.DoubleTapped(selected[0] as Models.Commit); + var source = e.Source as Control; + var item = source.FindAncestorOfType(); + if (item is { DataContext: Models.Commit commit }) + histories.DoubleTapped(commit); } e.Handled = true; }