add partial background downloading and update prompt
This commit is contained in:
@@ -45,9 +45,35 @@ namespace BlueMine
|
||||
Task getHoursTask = GetHours();
|
||||
|
||||
await Task.WhenAll(loadIssuesTask, getHoursTask);
|
||||
#if !DEBUG
|
||||
if(await UpdateManager.IsUpdateAvailable())
|
||||
{
|
||||
updateIcon.Visibility = Visibility.Visible;
|
||||
UpdateManager.DownloadCompleted += UpdateManager_DownloadCompleted;
|
||||
await UpdateManager.DownloadUpdateAsync();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
private async void UpdateManager_DownloadCompleted()
|
||||
{
|
||||
await Dispatcher.Invoke(async () =>
|
||||
{
|
||||
var result = await new Wpf.Ui.Controls.MessageBox
|
||||
{
|
||||
Title = "Frissítés elérhető",
|
||||
Content = "Szeretnél most frissíteni?",
|
||||
PrimaryButtonText = "Frissítés",
|
||||
SecondaryButtonText = "Később",
|
||||
IsCloseButtonEnabled = false,
|
||||
}.ShowDialogAsync();
|
||||
|
||||
if (result == Wpf.Ui.Controls.MessageBoxResult.Primary)
|
||||
await UpdateManager.PerformUpdate();
|
||||
});
|
||||
}
|
||||
|
||||
private void CalendarButtonClicked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
flyoutCalendar.IsOpen = true;
|
||||
|
||||
Reference in New Issue
Block a user