enhance: using lightweight ListBox instead of DataGrid to improve performance

This commit is contained in:
leo 2024-08-27 21:28:48 +08:00
parent 1f07c1bdf0
commit 7776cda475
No known key found for this signature in database
12 changed files with 465 additions and 529 deletions

View file

@ -154,16 +154,6 @@ namespace SourceGit.Views
}
}
private void OnSearchResultDataGridSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (sender is DataGrid { SelectedItem: Models.Commit commit } && DataContext is ViewModels.Repository repo)
{
repo.NavigateToCommit(commit.SHA);
}
e.Handled = true;
}
private void OnBranchTreeRowsChanged(object _, RoutedEventArgs e)
{
UpdateLeftSidebarLayout();
@ -236,7 +226,7 @@ namespace SourceGit.Views
e.Handled = true;
}
private void OnLeftSidebarDataGridPropertyChanged(object _, AvaloniaPropertyChangedEventArgs e)
private void OnLeftSidebarListBoxPropertyChanged(object _, AvaloniaPropertyChangedEventArgs e)
{
if (e.Property == ListBox.ItemsSourceProperty || e.Property == ListBox.IsVisibleProperty)
UpdateLeftSidebarLayout();