public override void RaisePropertyChanged([CallerMemberName] string propertyName = null) { base.RaisePropertyChanged(propertyName); GradientChanged?.Invoke(this); if (propertyName == nameof(Start)) { Start.Changed += delegate { GradientChanged?.Invoke(this); }; } else if (propertyName == nameof(End)) { End.Changed += delegate { GradientChanged?.Invoke(this); }; } }
private void Stops_Changed(object sender, EventArgs e) { foreach (var color in previousStops) { color.Changed -= Color_Changed; } previousStops = Stops.ToArray(); foreach (var color in previousStops) { color.Changed += Color_Changed; } GradientChanged?.Invoke(this); }
/// <summary> /// Fires the Gradient Changed event. /// </summary> protected virtual void OnGradientChanged() { GradientChanged?.Invoke(this, EventArgs.Empty); }
private void Color_Changed(object sender, EventArgs e) { GradientChanged?.Invoke(this); }