Пример #1
0
        private async void btnUpdateNow_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                UpdateData ud = await UpdateChecker.CheckForUpdatesAsync();

                if (ud.HasUpdate)
                {
                    UpdateDisplay uw = new UpdateDisplay(ud);
                    uw.Owner = this;
                    uw.ShowDialog();
                }
                else
                {
                    MessageDialog md = new MessageDialog(App.ColorScheme);
                    md.ShowDialog("There are no updates available. You're on the latest release!", App.ColorScheme, this, "Check for Updates", MessageDialogButtonDisplay.Auto, image: MessageDialogImage.Hand);
                }
            }
            catch (System.Net.WebException)
            {
                MessageDialog md = new MessageDialog(App.ColorScheme);
                md.ShowDialog("Could not check for updates. Make sure you're connected to the Internet.", App.ColorScheme, this, "Check for Updates", MessageDialogButtonDisplay.Auto, image: MessageDialogImage.Error);
            }
        }