ColorPicker doesn't triger color Change event after color change from UI
After clicking on UI on new color event doesn't trigger
ColorPicker.ColorChanged += ColorPicker_ColorChanged;
private void ColorPicker_ColorChanged(object sender, RoutedPropertyChangedEventArgs<Color> e)
{
// never triggered
}
You are right, it is only triggered if the color property is changed outside of the color picker.
@Keboo this is because if you change to color in the color picker, first the HsbPropertyChangedCallback is called, which sets _inCallback to true, but the ColorPropertyChangedCallback which fires the ColorChanged event then returns early because of this field beeing true.
I seem to have overlooked that when making my PR (or something changed in between).
I can make a PR to fix this and firing the event even if _inCallback istrue (it should not get called multiple times, right?)
I think multiple times - on every change not on Mouse Up.

I made workaround in my app to have this behavior and it works great. I call color getter on MouseMove Event. Mouse Move is called only when Mouse Left button and it suits me :) I am getting live upodate.
...
ColorPicker.MouseMove += ColorPicker_MouseMove;
}
// ...
private void ColorPicker_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
{
var items = ColorsList.Items;
ColorItem item;
for (int i = 0; i < items.Count; ++i)
{
item = (ColorItem)items[i];
if (item.IsSelected)
{
item.Color = ColorPicker.Color;
}
}
}
If you use binding you can also use the setter of the property bound to the Color property of the ColorPicker (that's how it is done in the Demo App)
@Keboo When I add raising event to every time the hsb value change callback is called the color tool get's very laggy. Do you have any idea how this could be done better? Maybe not using a routed event could improve it?