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...
Just set:
new Uri("about:blank");
Works for me.
You can do something like this
Uri uri = null;
bool someValue = Context.TryGetUri(entity, out uri);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With