Skip to content

Commit

Permalink
[oobe] fix scoobe page threading issues (microsoft#16532)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimecbernardo authored and mshtang committed Feb 28, 2022
1 parent 630a7ef commit 6641aed
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/settings-ui/Settings.UI/OOBE/Views/OobeWhatsNew.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,26 @@ private async void Page_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
TitleTxt.Text = loader.GetString("Oobe_WhatsNew");
try
{
ReleaseNotesMarkdown.Text = await GetReleaseNotesMarkdown();
ReleaseNotesMarkdown.Visibility = Windows.UI.Xaml.Visibility.Visible;
LoadingProgressRing.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
string releaseNotesMarkdown = await GetReleaseNotesMarkdown();

// Make sure we run in the UI thread. await doesn't seem to guarantee it.
await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
{
ReleaseNotesMarkdown.Text = releaseNotesMarkdown;
ReleaseNotesMarkdown.Visibility = Windows.UI.Xaml.Visibility.Visible;
LoadingProgressRing.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
});
}
catch (Exception ex)
{
Logger.LogError("Exception when loading the release notes", ex);
LoadingProgressRing.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
ErrorInfoBar.Visibility = Windows.UI.Xaml.Visibility.Visible;

// Make sure we run in the UI thread. await doesn't seem to guarantee it.
await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
{
LoadingProgressRing.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
ErrorInfoBar.Visibility = Windows.UI.Xaml.Visibility.Visible;
});
}
}

Expand Down

0 comments on commit 6641aed

Please sign in to comment.