MvxImageLoadingView auto ImageSource detection
See original GitHub issueImageSource
is needed as a previous step to load any image.
This is fine and a view will normally load the same image source type. But what happens if the type changes?
The edge case: I found myself doing an avatar picker. When a pic is selected, it will load the image from a local file. If the user save changes in the form, the image will upload to server and next time he/she opens up the screen it will load the avatar from internet. So the image source type can change from “file” to “url”. I could even want to load an embedded resource when the user image is not set yet.
In a mvvm scenario this is a bit tricky as you can´t simply bind DataLocation
.
My idea is to detect the source type automatically by examining the image path.
I certainly know that urls will start with “http”. But I´m not sure about the rest of the source types. For instance, in mvvvmcross, they solve this by adding “res:” prefix to embedded resources. I would prefer to use some kind of regex to infer the source type but at this point I´m not sure it can be done for all cases (need to investigate more)
Issue Analytics
- State:
- Created 8 years ago
- Comments:19 (10 by maintainers)
Top GitHub Comments
👍 I will try to integrate it during the week
@bspinner @xleon
MvxImageLoadingView
isobsolete
now and replaced withMvxCachedImageView