Your problem is that this Converter should not be in your .Core project (the one where your virtual machines are located). This code is platform specific because it changes the logical (something that is appropriate for your business logic) to Drawable (something that exists only on Android). Therefore, it should belong to your .Droid project.
In my projects, I create a Converters folder inside a Droid project to store all of my platform specific converters. The code for your MySwapImageValueConverter should look like this:
using System; using System.Globalization; using Cirrious.CrossCore.Converters; namespace MilkBottle.Droid.Converters { public class MySwapImageValueConverter : MvxValueConverter<bool, int> { #region Methods protected override int Convert(bool value, Type targetType, object parameter, CultureInfo culture) { var result = value ? Resource.Drawable.ImgTest1: Resource.Drawable.ImgTest2; return result; } #endregion } }
source share