Browse Source

Fix ColorSlider update/refresh for all property changes

pull/9140/head
robloo 4 years ago
parent
commit
98a58217ce
  1. 9
      src/Avalonia.Controls.ColorPicker/ColorSlider/ColorSlider.cs

9
src/Avalonia.Controls.ColorPicker/ColorSlider/ColorSlider.cs

@ -385,11 +385,11 @@ namespace Avalonia.Controls.Primitives
return; return;
} }
// Always keep the two color properties in sync
if (change.Property == ColorProperty) if (change.Property == ColorProperty)
{ {
ignorePropertyChanged = true; ignorePropertyChanged = true;
// Always keep the two color properties in sync
HsvColor = Color.ToHsv(); HsvColor = Color.ToHsv();
SetColorToSliderValues(); SetColorToSliderValues();
@ -402,7 +402,10 @@ namespace Avalonia.Controls.Primitives
ignorePropertyChanged = false; ignorePropertyChanged = false;
} }
else if (change.Property == ColorModelProperty) else if (change.Property == ColorComponentProperty ||
change.Property == ColorModelProperty ||
change.Property == IsAlphaMaxForcedProperty ||
change.Property == IsSaturationValueMaxForcedProperty)
{ {
ignorePropertyChanged = true; ignorePropertyChanged = true;
@ -416,6 +419,7 @@ namespace Avalonia.Controls.Primitives
{ {
ignorePropertyChanged = true; ignorePropertyChanged = true;
// Always keep the two color properties in sync
Color = HsvColor.ToRgb(); Color = HsvColor.ToRgb();
SetColorToSliderValues(); SetColorToSliderValues();
@ -440,6 +444,7 @@ namespace Avalonia.Controls.Primitives
_backgroundBitmap = null; _backgroundBitmap = null;
UpdateBackground(); UpdateBackground();
UpdatePseudoClasses();
} }
else if (change.Property == ValueProperty || else if (change.Property == ValueProperty ||
change.Property == MinimumProperty || change.Property == MinimumProperty ||

Loading…
Cancel
Save