예제 #1
0
 public static async Task RequestRestartAsync()
 {
     if (ApiInformation.IsMethodPresent("Windows.ApplicationModel.Core.CoreApplication", "RequestRestartAsync"))
     {
         var resources = ResourceLoader.GetForCurrentView("ThemesSettingsPage");
         if (await UIUtilities.ShowYesNoDialogAsync(resources.GetString("ThemeChangedTitle"), resources.GetString("ThemeChangedMessage")))
         {
             await CoreApplication.RequestRestartAsync("");
         }
     }
 }
예제 #2
0
        public static async Task <Theme> SafeInstallFromArchiveAsync(StorageFile theme, bool noPrompt = false)
        {
            try
            {
                return(await ThemeManager.InstallFromArchiveAsync(theme, noPrompt));
            }
            catch (Exception ex)
            {
                Logger.LogError(ex);
                await UIUtilities.ShowErrorDialogAsync("Failed to install theme!", ex.Message);
            }

            return(null);
        }