From 262c7afe9eea67c038d7bffe37424d83fef5f9ab Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 30 Apr 2021 09:41:19 +0800 Subject: [PATCH] optimize: use async binding for side-by-side diff --- src/Views/Widgets/DiffViewer.xaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Views/Widgets/DiffViewer.xaml.cs b/src/Views/Widgets/DiffViewer.xaml.cs index 69270484..fa6fa62a 100644 --- a/src/Views/Widgets/DiffViewer.xaml.cs +++ b/src/Views/Widgets/DiffViewer.xaml.cs @@ -336,11 +336,11 @@ namespace SourceGit.Views.Widgets { oldEditor.Columns[0].Width = new DataGridLength(lineNumberWidth, DataGridLengthUnitType.Pixel); oldEditor.Columns[1].MinWidth = minWidth; - oldEditor.ItemsSource = oldSideBlocks; + oldEditor.SetBinding(DataGrid.ItemsSourceProperty, new Binding() { Source = oldSideBlocks, IsAsync = true }); newEditor.Columns[0].Width = new DataGridLength(lineNumberWidth, DataGridLengthUnitType.Pixel); newEditor.Columns[1].MinWidth = minWidth; - newEditor.ItemsSource = newSideBlocks; + newEditor.SetBinding(DataGrid.ItemsSourceProperty, new Binding() { Source = newSideBlocks, IsAsync = true }); }); }