L
Lloyd Dupont
I have a color chooser class
class ColorPicker : Control
{
public byte R { get; set; }
public byte G { get; set; }
public byte B { get; set; }
public Color Color { get; set; }
}
All are dependency properties.
All these dependency properties are obviously related, when Red change,
Color change and vice versa.
Now I wonder how to update them as a whole.
If I do it directly mysefl as in:
When R change I call SetValue(ColorProperty, newValue)
That feel wrong.
Because if the user call, let's say:
ClearValue(ColorProperty) I end up calling SetValue(RProperty, ..), while I
should in fact clear it...
does it makes sense?
How should I synchronize values?
class ColorPicker : Control
{
public byte R { get; set; }
public byte G { get; set; }
public byte B { get; set; }
public Color Color { get; set; }
}
All are dependency properties.
All these dependency properties are obviously related, when Red change,
Color change and vice versa.
Now I wonder how to update them as a whole.
If I do it directly mysefl as in:
When R change I call SetValue(ColorProperty, newValue)
That feel wrong.
Because if the user call, let's say:
ClearValue(ColorProperty) I end up calling SetValue(RProperty, ..), while I
should in fact clear it...
does it makes sense?
How should I synchronize values?