1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-31 09:43:46 +00:00

Color gradient property - Trigger PropertyChanged on data binding update

This commit is contained in:
Robert 2021-03-04 20:02:07 +01:00
parent ef66511564
commit 6ba3e6941d

View File

@ -26,12 +26,14 @@ namespace Artemis.Core
for (int index = 0; index < CurrentValue.Stops.Count; index++) for (int index = 0; index < CurrentValue.Stops.Count; index++)
{ {
int stopIndex = index; int stopIndex = index;
RegisterDataBindingProperty(
() => CurrentValue.Stops[stopIndex].Color, void Setter(SKColor value)
value => CurrentValue.Stops[stopIndex].Color = value, {
new ColorStopDataBindingConverter(), CurrentValue.Stops[stopIndex].Color = value;
$"Color #{stopIndex + 1}" CurrentValue.OnColorValuesUpdated();
); }
RegisterDataBindingProperty(() => CurrentValue.Stops[stopIndex].Color, Setter, new ColorStopDataBindingConverter(), $"Color #{stopIndex + 1}");
} }
} }