Skip to content

Commit ea295a8

Browse files
author
Florian Krabbenhoeft
committed
Allow setting UriSource to null.
1 parent e8b120f commit ea295a8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Source/SVGImage/SVG/SVGImage.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,15 @@ private static void OnUriSourceChanged(DependencyObject obj, DependencyPropertyC
716716
}
717717

718718
var sourceUri = (Uri)args.NewValue;
719-
svgImage.SetImage(sourceUri);
719+
if (sourceUri != null)
720+
{
721+
svgImage.SetImage(sourceUri);
722+
}
723+
else
724+
{
725+
svgImage.SetImage((Drawing)null);
726+
}
727+
720728
}
721729

722730
static void OnSizeTypeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)

0 commit comments

Comments
 (0)