From 316344939aba34dc5a927a7b7e5e508d00af7bc0 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 5 Aug 2021 09:36:06 +0800 Subject: [PATCH] optimize: move graph.SetData out from UI thread --- src/Views/Controls/HighlightableTextBlock.cs | 3 +-- src/Views/Widgets/Histories.xaml.cs | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Views/Controls/HighlightableTextBlock.cs b/src/Views/Controls/HighlightableTextBlock.cs index 8edcd1e5..bc6707c2 100644 --- a/src/Views/Controls/HighlightableTextBlock.cs +++ b/src/Views/Controls/HighlightableTextBlock.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using System.Windows; +using System.Windows; using System.Windows.Media; using System.Windows.Controls; using System.Windows.Documents; diff --git a/src/Views/Widgets/Histories.xaml.cs b/src/Views/Widgets/Histories.xaml.cs index 7e136c37..da0feaa5 100644 --- a/src/Views/Widgets/Histories.xaml.cs +++ b/src/Views/Widgets/Histories.xaml.cs @@ -92,10 +92,11 @@ namespace SourceGit.Views.Widgets { } } + graph.SetData(visible, searching); + Dispatcher.Invoke(() => { loading.IsAnimating = false; loading.Visibility = Visibility.Collapsed; - graph.SetData(visible, searching); commitList.ItemsSource = visible; }); }