Exemplo n.º 1
0
        public ClassificationColorViewModel(
            string classificationName, Color classificationColor, bool colorWasReset, IResetValuesProvider resetValuesProvider)
        {
            _color     = classificationColor;
            _colorText = _color.ToString();

            ColorWasReset = colorWasReset;

            CustomizeColor = new DelegateCommand(() =>
            {
                if (TryGetColor(out var color))
                {
                    Color = color;
                }
            });
            ResetColor = new DelegateCommand(() =>
            {
                Color         = resetValuesProvider.GetForeground(classificationName);
                ColorWasReset = true;
            });

            ColorLostFocus = new DelegateCommand(SetColorText);
        }