dotnetprojects / SVGImage

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

only assign svgimage source if new value is not null #54

Closed DrCopyPaste closed 3 years ago

DrCopyPaste commented 3 years ago

(this might be the case for instance when changing/overriding the used resourcedictionary)

just a small change, I noticed this was the only error I was getting when I was trying to switch application wide styles, because I suppose it would leave the svgimage without a value when removing the currently used resource dictionary before applying a new one - hence ignore empty values in OnSourceChanged...

Probably could make sense to do this check for UriSource too, but I just tested it for Source ;) I got a working example here https://github.com/DrCopyPaste/RecNForget/tree/feature/embedForkSvgImage

jogibear9988 commented 3 years ago

And what's the case if you'd like to set it to null? (for example to remove the image?) How does the WPF Image COntrol work in this way? will it also ignore? I think we should do the same.

DrCopyPaste commented 3 years ago

Yes of course you are right, standard Image control allows setting to null, I have updated the branch so this now also works for svgimage

rstroilov commented 3 years ago

We now have the bug because of NRE from SvgImage. @jogibear9988 , are there any plans to merge current PR and publish the updated package?

jogibear9988 commented 3 years ago

I've merged...

Sorry I did not see the updated pull req... I get to many github mails every day....

jogibear9988 commented 3 years ago

thx

jogibear9988 commented 3 years ago

nuget should automaticly be provided

DrCopyPaste commented 3 years ago

thx