dotnetprojects / SVGImage

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

Images do not reload on OverrideColor change #48

Closed Fi0x closed 3 years ago

Fi0x commented 3 years ago

When I change the OverrideColor property, the image does not get re-loaded with the new value. I have to use a workaround that uses SetImage.

But I don't think that this is intentional?

jogibear9988 commented 3 years ago

does it work when you call https://github.com/dotnetprojects/SVGImage/blob/80c89fbf6a3aa2551018cae156aaf761bc97696c/Source/SVGImage/SVG/SVGImage.cs#L221

then i think we need a ChangeNotification in this dependecy property:

https://github.com/dotnetprojects/SVGImage/blob/80c89fbf6a3aa2551018cae156aaf761bc97696c/Source/SVGImage/SVG/SVGImage.cs#L92

but I've no time to work on this at the moment. Maybe you could and create a pull req?

Fi0x commented 3 years ago

So I tried to replace SetImage with ReRenderSvg, but unfortunately this does not work.

I'm currently very busy myself, but if I find some time, I'll create a pull-request.

DrCopyPaste commented 3 years ago

Had the same issue, was able to reproduce this in a simple sample on the example app (double click the rect-image to randomly change color)

this code resolved it for me: https://github.com/dotnetprojects/SVGImage/pull/49