public void SaveSettings() { var task = ThreadPool.RunAsync((work) => { Cities.Save(); Immersive.Save(); Preferences.Save(); LocalSettingsHelper.WriteSettingsValue("Inited", true); }); }
internal static async Task <CurrentImmersiveList> Get(string title) { var uris = await Immersive.GetThumbnailsFromAssetsAsync(title); var self = new CurrentImmersiveList(); foreach (var item in uris) { self.Add(new BackgroundSelector(item.Key, item.Value)); } return(self); }
internal void ChangeCurrentList(int index) { var task = ThreadPool.RunAsync(async(work) => { CurrentList = null; CurrentList = await CurrentImmersiveList.Get(PivotList[index]); var lUri = await Immersive.GetFileFromLocalAsync(PivotList[index]); await CheckandSetlocalFile(lUri); immersive.CheckLocal(PivotList[index], lUri); SaveAll(); OnFetchDataComplete(); }); }
public static SettingsModel Get() { var s = new SettingsModel(); s.Cities = Cities.Get(); s.Immersive = Immersive.Get(); s.Preferences = Preferences.Get(); var init = LocalSettingsHelper.ReadSettingsValue("Inited"); if (init == null) { s.Inited = false; } else { s.Inited = true; } return(s); }
public ImmersiveSettingViewModel() { var p = SettingsModel.Current.Preferences; Theme = p.GetTheme(); var task = ThreadPool.RunAsync(async(work) => { immersive = SettingsModel.Current.Immersive; PivotList = new ImmersiveGroup(); CurrentList = await CurrentImmersiveList.Get(PivotList[0]); var lUri = await Immersive.GetFileFromLocalAsync(PivotList[0]); await CheckandSetlocalFile(lUri); immersive.CheckLocal(PivotList[0], lUri); rePick(); await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.High, new DispatchedHandler(() => { SunnyState = immersive.Sunny; StarryState = immersive.Starry; CloudyState = immersive.Cloudy; OvercastState = immersive.Overcast; RainnyState = immersive.Rainny; SnowyState = immersive.Snowy; FoggyState = immersive.Foggy; HazeState = immersive.Haze; SunnyShuffle = immersive.SunnyShuffle; StarryShuffle = immersive.StarryShuffle; CloudyShuffle = immersive.CloudyShuffle; OvercastShuffle = immersive.OvercastShuffle; RainnyShuffle = immersive.RainnyShuffle; SnowyShuffle = immersive.SnowyShuffle; FoggyShuffle = immersive.FoggyShuffle; HazeShuffle = immersive.HazeShuffle; })); OnFetchDataComplete(); }); }