From 1a9af440a60ef6d3a980ad8db28d58447fc8096b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wies=C5=82aw=20S=CC=8Colte=CC=81s?= Date: Thu, 14 Mar 2024 23:48:44 +0100 Subject: [PATCH] Update SvgImage.cs --- src/Avalonia.Svg/SvgImage.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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); }