diff --git a/src/Avalonia.Svg/SvgImage.cs b/src/Avalonia.Svg/SvgImage.cs index bfd1598a..473d2fa5 100644 --- a/src/Avalonia.Svg/SvgImage.cs +++ b/src/Avalonia.Svg/SvgImage.cs @@ -13,6 +13,11 @@ namespace Avalonia.Svg; /// public class SvgImage : AvaloniaObject, IImage { + /// + /// Raised when the resource changes visually. + /// + public event EventHandler? Invalidated; + /// /// Defines the property. /// @@ -92,9 +97,17 @@ void IImage.Draw( protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) { base.OnPropertyChanged(change); + if (change.Property == SourceProperty) { // TODO: Invalidate IImage + RaiseInvalidated(EventArgs.Empty); } } + + /// + /// Raises the event. + /// + /// The event args. + protected void RaiseInvalidated(EventArgs e) => Invalidated?.Invoke(this, e); }