benruehl / adonis-ui

Lightweight UI toolkit for WPF applications offering classic but enhanced windows visuals
https://benruehl.github.io/adonis-ui/
MIT License
1.71k stars 143 forks source link

[BUGFIX] AdonisWindow not being able to handle setting the IconProperty manually #100

Closed Insire closed 4 years ago

Insire commented 4 years ago

When setting the IconProperty of a (Adonis-)Window instance, a System.UriFormatException is being thrown from this line, when the ToString method of that object doesnt evaluate to a valid Uri.

Such is the case for objects that represent an actual image, such as any class that derives from ImageSource.

This PR takes those cases into account and skips the fallback logic that tries turning them into valid URIs.

benruehl commented 4 years ago

Although I don't have an actual use case for this on my mind, it makes sense to me that this should be supported.

Thanks a lot for contributing again!