From 215ca8ccfff52dcfbc2d44ca71f9e35ab5fe5ba0 Mon Sep 17 00:00:00 2001 From: Gerald Lochner Date: Thu, 28 Apr 2016 15:35:36 +0200 Subject: [PATCH] When using SDA the initialization of recent projects on start page, because after await another thread tried to access ItemSource --- .../Project/Src/RecentProjectsControl.xaml.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/AddIns/Misc/StartPage/Project/Src/RecentProjectsControl.xaml.cs b/src/AddIns/Misc/StartPage/Project/Src/RecentProjectsControl.xaml.cs index 98caf6a274d..78444264d2f 100644 --- a/src/AddIns/Misc/StartPage/Project/Src/RecentProjectsControl.xaml.cs +++ b/src/AddIns/Misc/StartPage/Project/Src/RecentProjectsControl.xaml.cs @@ -79,10 +79,15 @@ await Task.Run( } } }); - if (items.Count > 0) { - lastProjectsListView.ItemsSource = items; - lastProjectsListView.Visibility = Visibility.Visible; - } + + await Dispatcher.InvokeAsync(delegate + { + if (items.Count > 0) + { + lastProjectsListView.ItemsSource = items; + lastProjectsListView.Visibility = Visibility.Visible; + } + }); } class RecentOpenItem : INotifyPropertyChanged