예제 #1
0
        public SettingsPageViewModel(IResourceScope scope, ISettingsService settings) : base(scope)
        {
            _settings = settings;
            var swatches = new SwatchesProvider().Swatches.ToArray();

            MainHues   = swatches.Select(x => x.ExemplarHue?.Color).Where(x => x != null).Select(x => x.Value);
            AccentHues = swatches.Select(x => x.AccentExemplarHue?.Color).Where(x => x != null).Select(x => x.Value);

            _settings.PropertyChanged += SettingsPropertyChanged;
        }
예제 #2
0
        static SearchCriterionViewModel()
        {
            var swatches = new SwatchesProvider().Swatches.ToList();

            AvailableColors = swatches.Select(sw =>
            {
                var hues = sw.PrimaryHues.ToArray();
                return(new[] { hues[1], hues[2], hues[3], hues[5] });
            }).SelectMany(h => h).ToArray();
        }