Esempio n. 1
0
        public static async Task ApplySetting(SettingObject setting)
        {
            LocalWallpaperDir = Setting.General.WallpaperSaveDir;
            string cultureName = setting.General.CurrentLan;

            if (cultureName == null)
            {
                cultureName = Thread.CurrentThread.CurrentUICulture.Name;
            }

            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(cultureName);
            await LanService.UpdateLanguage();

            try
            {
                await _desktopBridgeStartupManager.Set(setting.General.StartWithWindows);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
            }
            setting.General.StartWithWindows = await _desktopBridgeStartupManager.Check();

            //WallpaperManager.VideoAspect = setting.Wallpaper.VideoAspect;
            LiveWallpaper.WallpaperManager.WallpaperManager.ApplyVideoAspect(setting.Wallpaper.VideoAspect);
        }
        private async void cb_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ComboBoxItem item    = e.AddedItems[0] as ComboBoxItem;
            string       culture = item.Tag as string;

            ApplicationLanguages.PrimaryLanguageOverride = culture;
            await LanService.UpdateLanguage();
        }
Esempio n. 3
0
        private void Cb_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ComboBoxItem item    = e.AddedItems[0] as ComboBoxItem;
            string       culture = item.Tag as string;

            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(culture);
            LanService.UpdateLanguage();
        }
Esempio n. 4
0
        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            var vm      = configer.DataContext as ConfigerViewModel;
            var data    = ConfigerService.GetData <Setting>(vm.Nodes);
            var setting = await JsonHelper.JsonSerializeAsync(data, path);

            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(data.S3);
            await LanService.UpdateLanguage();
        }
Esempio n. 5
0
        public static async Task ApplySetting(SettingObject setting)
        {
            Setting = setting;

            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(setting.General.CurrentLan);
            await LanService.UpdateLanguage();

            await AutoStartupHelper.Instance.Set(setting.General.StartWithWindows);

            setting.General.StartWithWindows = await AutoStartupHelper.Instance.Check();

            WallpaperManager.VideoAspect = setting.Wallpaper.VideoAspect;
            WallpaperManager.ApplyVideoAspect();
        }
Esempio n. 6
0
        public static async Task ApplySetting(SettingObject setting)
        {
            LocalWallpaperDir = Setting.General.WallpaperSaveDir;
            string cultureName = setting.General.CurrentLan;

            if (cultureName == null)
            {
                cultureName = Thread.CurrentThread.CurrentUICulture.Name;
            }

            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(cultureName);
            await LanService.UpdateLanguage();

            await AutoStartupHelper.Instance.Set(setting.General.StartWithWindows);

            setting.General.StartWithWindows = await AutoStartupHelper.Instance.Check();

            //WallpaperManager.VideoAspect = setting.Wallpaper.VideoAspect;
            WallpaperManager.ApplyVideoAspect(setting.Wallpaper.VideoAspect);
        }
Esempio n. 7
0
        public static async Task ApplySetting(SettingObject setting)
        {
            LocalWallpaperDir = Setting.General.WallpaperSaveDir;
            string cultureName = setting.General.CurrentLan;

            if (cultureName == null)
            {
                cultureName = Thread.CurrentThread.CurrentUICulture.Name;
            }

            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(cultureName);
            await LanService.UpdateLanguage();

            try
            {
                await _startupManager.Set(setting.General.StartWithWindows);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
            }
            setting.General.StartWithWindows = await _startupManager.Check();

            var screenSetting = WallpaperManager.Instance.ScreenIndexs.Select((m) => new ScreenOption()
            {
                ScreenIndex      = m,
                WhenAppMaximized = setting.Wallpaper.ActionWhenMaximized,
            }).ToList();

            var liveWallpaperOptions = new LiveWallpaperOptions
            {
                AppMaximizedEffectAllScreen = true,
                AudioScreenIndex            = setting.Wallpaper.AudioSource,
                ScreenOptions = screenSetting
            };

            await WallpaperManager.Instance.SetOptions(liveWallpaperOptions);
        }