0

As stated in this question I need to load an image from Url using Xamarin.Forms with MVVMCross 4.4.0.

I was directed to use the FFimageLoading package in that question but it is not working, after searching I found that the FFimageLoading library has this axml tag:

<ffimageloading.cross.MvxImageLoadingView/>

I have a MvxListView and in each ListItem I need to show an image from Url, but there's no way as Xamarin.forms and Mvx.MvximageView ImageUrl are using diferent versions of the same dependency.

I have a Model class with String imgUrl, a viewModel with a observableCollection<myclass> items wich has the imgUrl ( items.imgUrl ) but when I try to bind in axml it is not working.

<ffimageloading.cross.MvxImageLoadingView
            android:layout_width="100dp"
        android:layout_height="100dp"
            local:MvxBind="Source imgUrl" />
Cœur
  • 37,241
  • 25
  • 195
  • 267
Setar
  • 140
  • 10
  • Maybe you can directly take the code, it's not much: https://github.com/luberda-molinet/FFImageLoading/blob/master/source/FFImageLoading.Cross/MvxImageLoadingView.cs then propose a PR if there is a bug? – Fabien Dec 02 '16 at 07:00

2 Answers2

1

First of all: You are using Xamarin.Forms but you are also talking about a axml-view in your android project. I know, sometimes there is no other way, but try to keep your UI together in your shared/pcl project (because it's one of the main cases of using Xamarin.Forms).

I never worked with the MvvmCross view of the plugin (MvxImageLoadingView), but I think you should use a an UriImageSource as type of your imgUrl property instead of just a string (looking at this page in the documentation).

Joehl
  • 3,671
  • 3
  • 25
  • 53
  • i get 'Xamarin.Forms.UriImageSource' cannot be converted to type 'System.Nullable`1[FFImageLoading.Work.ImageSource]'. so i cast it to FFImageLoading.Work.ImageSource but .... System.InvalidCastException: Specified cast is not valid. – Setar Nov 29 '16 at 17:45
0

Dont use xamarin.forms with mvvmcross4.4.0 at 02/12/2016.

xamarin forms has dependencies to old versions off android.support.appcompat.v4/v7 so i cant use the Mvx.MvxImageView to show images from Url, and implementing a navigation menu is so hard.

this is my conclusion about this issue i created. I'm going to remove xamarin forms of my solution.

Setar
  • 140
  • 10