private void UpdateThemeItems()
 {
     ThemeItems.Clear();
     ThemeItems.Add(new BandThemeColorViewModel("Base", () => theme.Base, color => theme.Base = color));
     ThemeItems.Add(new BandThemeColorViewModel("High Contrast", () => theme.HighContrast, color => theme.HighContrast = color));
     ThemeItems.Add(new BandThemeColorViewModel("Highlight", () => theme.Highlight, color => theme.Highlight           = color));
     ThemeItems.Add(new BandThemeColorViewModel("Lowlight", () => theme.Lowlight, color => theme.Lowlight = color));
     ThemeItems.Add(new BandThemeColorViewModel("Muted", () => theme.Muted, color => theme.Muted          = color));
     ThemeItems.Add(new BandThemeColorViewModel("Secondary Text", () => theme.SecondaryText, color => theme.SecondaryText = color));
 }
예제 #2
0
        public void AddStyle(IStyle style, Interval interval)
        {
            var quantityThemeItem = new QuantityThemeItem(interval, style);

            ThemeItems.Add(quantityThemeItem);
        }
예제 #3
0
        public SettingsPageViewModel(INavigationService navigationService, IResourceLoader resourceLoader, DialogService dialogService)
        {
            _navigationService = navigationService;
            _resourceLoader    = resourceLoader;
            _dialogService     = dialogService;
            SettingsLocal      = SettingsService.Instance.LocalSettings;
            SettingsRoaming    = SettingsService.Instance.RoamingSettings;

            PreviewImageDownloadModes.Add(new PreviewImageDownloadModeItem
            {
                Name  = resourceLoader.GetString("Always"),
                Value = PreviewImageDownloadMode.Always
            });

            PreviewImageDownloadModes.Add(new PreviewImageDownloadModeItem
            {
                Name  = resourceLoader.GetString("WiFiOnly"),
                Value = PreviewImageDownloadMode.WiFiOnly
            });

            PreviewImageDownloadModes.Add(new PreviewImageDownloadModeItem
            {
                Name  = resourceLoader.GetString("Never"),
                Value = PreviewImageDownloadMode.Never
            });

            switch (SettingsLocal.PreviewImageDownloadMode)
            {
            case PreviewImageDownloadMode.Always:
                PreviewImageDownloadModesSelectedIndex = 0;
                break;

            case PreviewImageDownloadMode.WiFiOnly:
                PreviewImageDownloadModesSelectedIndex = 1;
                break;

            case PreviewImageDownloadMode.Never:
                PreviewImageDownloadModesSelectedIndex = 2;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            UseWindowsHello = SettingsLocal.UseWindowsHello;
            IgnoreServerCertificateErrors = SettingsLocal.IgnoreServerCertificateErrors;
            ExpertMode = SettingsLocal.ExpertMode;

            ResetCommand = new DelegateCommand(Reset);
            ShowHelpExpertModeCommand = new DelegateCommand(ShowHelpExpertMode);
            ShowHelpIgnoreInvalidSslCertificatesCommand = new DelegateCommand(ShowHelpInvalidSslCertificates);

            ThemeItems.Add(new ThemeItem
            {
                Name  = resourceLoader.GetString(ResourceConstants.ThemeSystem),
                Value = Theme.System
            });

            ThemeItems.Add(new ThemeItem
            {
                Name  = resourceLoader.GetString(ResourceConstants.ThemeDark),
                Value = Theme.Dark
            });

            ThemeItems.Add(new ThemeItem
            {
                Name  = resourceLoader.GetString(ResourceConstants.ThemeLight),
                Value = Theme.Light
            });

            switch (SettingsRoaming.Theme)
            {
            case Theme.System:
                ThemeModeSelectedIndex = 0;
                break;

            case Theme.Dark:
                ThemeModeSelectedIndex = 1;
                break;

            case Theme.Light:
                ThemeModeSelectedIndex = 2;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            GetServerVersion();
        }