dotnetprojects / SVGImage

A SVGImage Control for WPF
http://dotnetprojects.github.io/SVGImage/
MIT License
199 stars 41 forks source link

[BUG] NullReferenceException when placing an SVGImage inside a DataGridCheckboxColumn #94

Closed lukas-kirschner closed 7 months ago

lukas-kirschner commented 7 months ago

Describe the bug When I place an SVGImage inside a DataGridCheckboxColumn and change the DataContext, my program crashes with a System.NullReferenceException inside the OnSourceChanged method of the SVGImage.

To Reproduce Steps to reproduce the behavior:

  1. Create a User Control X with a Datagrid and a DataGridCheckboxColumn, place an SVGImage inside the DataGridCheckboxColumn and set its URI to a relative path that points to an existing SVG resource
  2. Create a ContentPresenter inside a different UserControl
  3. Programmatically change the Content of the ContentControl to different instances of the UserControl X

Expected behavior The SVGImage is displayed correctly with its Source set to some existing URI, and invisible with the source set to Null or DependencyProperty.UnsetValue.

Additional context The problem occurred with SVGImage 5.1.1 and .NET8

jogibear9988 commented 7 months ago

thx

larshjohannesson commented 7 months ago

We have this issue also. Is there any release pending to Nuget including this fix?

jogibear9988 commented 7 months ago

released atm. will take a few minutes on nuget

larshjohannesson commented 7 months ago

released atm. will take a few minutes on nuget

We have updated to 5.2.0 from Nuget but still seeing the issue. From what I can see on Github release 5.20 is still based on source from Dec 2023? image

jogibear9988 commented 7 months ago

Now?

larshjohannesson commented 7 months ago

Now?

Yes, thank you!