Skip to content

Commit

Permalink
Update SvgImage.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
wieslawsoltes committed Mar 14, 2024
1 parent 001cf40 commit 1a9af44
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Avalonia.Svg/SvgImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ namespace Avalonia.Svg;
/// </summary>
public class SvgImage : AvaloniaObject, IImage
{
/// <summary>
/// Raised when the resource changes visually.
/// </summary>
public event EventHandler? Invalidated;

/// <summary>
/// Defines the <see cref="Source"/> property.
/// </summary>
Expand Down Expand Up @@ -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);
}
}

/// <summary>
/// Raises the <see cref="Invalidated"/> event.
/// </summary>
/// <param name="e">The event args.</param>
protected void RaiseInvalidated(EventArgs e) => Invalidated?.Invoke(this, e);
}

0 comments on commit 1a9af44

Please sign in to comment.