diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index 5d543b65c..442f57033 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -40,6 +40,7 @@ public int ActiveTabIndex if (value != _sharedData.ActiveTabIndex) { _sharedData.ActiveTabIndex = value; + OnPropertyChanged(nameof(ActiveTabIndex)); if (value == 1 && DiffContext == null && _selectedChanges is { Count: 1 }) DiffContext = new DiffContext(_repo.FullPath, new Models.DiffOption(_commit, _selectedChanges[0])); diff --git a/src/Views/CommitDetail.axaml.cs b/src/Views/CommitDetail.axaml.cs index f1640b443..91bada728 100644 --- a/src/Views/CommitDetail.axaml.cs +++ b/src/Views/CommitDetail.axaml.cs @@ -6,7 +6,6 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Input; -using Avalonia.LogicalTree; using Avalonia.Platform.Storage; using Avalonia.VisualTree; @@ -532,11 +531,8 @@ private void OnChangeDoubleTapped(object sender, TappedEventArgs e) { if (DataContext is ViewModels.CommitDetail detail && sender is Grid { DataContext: Models.Change change }) { - var tabControl = this.FindLogicalDescendantOfType(); - if (tabControl != null) - tabControl.SelectedIndex = 1; - detail.SelectedChanges = new() { change }; + detail.ActiveTabIndex = 1; } e.Handled = true;