Dirkster99 / ColorPickerLib

A WPF/MVVM implementation of a themeable color picker control.
MIT License
47 stars 13 forks source link

Colors in ColorPicker Default to Semi Transparent #5

Closed markolbert closed 3 years ago

markolbert commented 3 years ago

With apologies for being new to WPF... I'm using the pre-release version of the MVVM community toolkit.

If I bind ColorPicker to a Color value like this:

<cpkr:ColorPicker Grid.Column="1" Grid.Row="1"
                              HorizontalAlignment="Left"
                              SelectedColor="{Binding RouteColor, Mode=TwoWay}"/>

and the modelview definition of the property is like this:

        private Color _routeColor = Color.Red;

        public MainViewModel()
        {
            RouteColor = Color.Red;
        }

        public Color RouteColor
        {
            get => _routeColor;

            set
            {
                SetProperty( ref _routeColor, value );

                _appConfig.RouteColor = value;
            }
        }

then the color displays as semi-transparent (alpha channel value 128). In fact, it doesn't appear like the binding is working, since changing the color to Blue doesn't change what gets displayed.

markolbert commented 3 years ago

Sigh. I think the problem is elsewhere. I'm closing this issue for now.