How to handle Empty Uri's for Path Binding to an Image Source

c#, mvvm, wpf

Solution

Just set:

new Uri("about:blank");

Works for me.

Problem

how can I initialize an Uri object in an empty state. First thought would be to do something like this ``` //does not work Uri myUri = Uri.Empty ``` This one does also not work ``` Uri myUri = new Uri(string.Empty) ``` The reason is I store my image path in the db and in case there is no image defined I have a blank database record. I know that there are ways to handle this with a converter and return a default blank image Uri in case the image_path is empty... How do I handle the binding to my ViewModel Uri Property best? Is the converter the way to go and how do you handle it if you would have like many different default images which should be returned...

Original source