private UpdateAvailableDialog(Appcast appcast) { ReleaseNotesLink = appcast.ReleaseNotesLink; NewVersion = appcast.Version; DataContext = this; InitializeComponent(); if (GuiController.AppIcon != null) { ImageSource imSource = GuiController.ToImageSource(GuiController.AppIcon); Icon = imSource; GuiImage.Source = imSource; } if (!string.IsNullOrEmpty(ReleaseNotesLink)) { try { GuiWebBrowser.Source = new Uri(ReleaseNotesLink); } catch (Exception) { // ignore errors } } else { GuiWebBrowser.Visibility = Visibility.Collapsed; } }
public static void ShowWindow(Appcast appcast) { Application.Current.Dispatcher.Invoke(() => { _currentWindow = new UpdateAvailableDialog(appcast); _currentWindow.Owner = Application.Current.MainWindow; _currentWindow.Show(); }); }
private static void Updater_NewUpdateAvailable(Appcast appcast) { UpdateAvailableDialog.ShowWindow(appcast); }
static void Updater_AppcastDownloadFinished(Appcast appcast) { HideWindows(); }