public override object Clone() { var gradientTheme = new GradientTheme { AttributeName = AttributeName, minValue = minValue, maxValue = maxValue, fillColorBlend = (null != FillColorBlend) ? (ColorBlend)FillColorBlend.Clone() : null, lineColorBlend = (null != LineColorBlend) ? (ColorBlend)LineColorBlend.Clone() : null, textColorBlend = (null != TextColorBlend) ? (ColorBlend)TextColorBlend.Clone() : null, numberOfClasses = numberOfClasses, minColor = minColor, maxColor = maxColor }; gradientTheme.themeItems.AddRange(ThemeItems.Select(ti => (IThemeItem)((GradientThemeItem)ti).Clone())); gradientTheme.minItem = (GradientThemeItem)gradientTheme.themeItems.First(); gradientTheme.maxItem = (GradientThemeItem)gradientTheme.themeItems.Last(); if (NoDataValues != null) { gradientTheme.noDataValues = NoDataValues.Cast <object>().ToArray(); } return(gradientTheme); }
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)); }
public void AddStyle(IStyle style, Interval interval) { var quantityThemeItem = new QuantityThemeItem(interval, style); ThemeItems.Add(quantityThemeItem); }
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(); }