In my case path "MyZooSnap.Core;component/Resources/Images/i.jpg".
How to convert path for Android ImageView?
In order to use it in the following binding:
{'AssetImagePath':{'Path':'ImagePath'}}
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Quick answer:
assets/images/i1.pngAndroidAssetimages/i1.pngLonger answer:
Ideally your ViewModel should be platform independent and not know about View concerns.
So your ViewModel might perhaps expose a property like:
where GameState is an enumeration like:
you might then have images representing these states in an assets structure like:
where each of those files is marked with BuildAction of AndroidAsset.
To then display the correct image in the UI, you would need a value converter like:
mapped in using a Converters wrapper like:
which is configured in setup.cs using:
With this in place, then your axml binding statement would be:
For an alternative approach using resources instead of assets, see
MvxButtonIconBindingin Іssue with binding to GridLayout to Android