Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I could not fix the problem. My MainViewModel.cs</p> <pre><code>public class MainMenuViewModel : MvxViewModel { private const string path = "myimage"; public List&lt;SquareModel&gt; Items { get; set; } public IMvxCommand ShowItemCommand { get { return new MvxRelayCommand&lt;Type&gt;((type) =&gt; this.RequestNavigate(typeof(MainMenuViewModel))); } } public MainMenuViewModel() { Items = GetCollection(); } public List&lt;SquareModel&gt; GetCollection() { List&lt;SquareModel&gt; col = new List&lt;SquareModel&gt;(); for (int i = 0; i &lt; 20; i++) { col.Add(new SquareModel { ID = i, PathImage = path }); } return col; } } </code></pre> <p>My Converts.cs</p> <pre><code>public class Converters { public readonly PathImageConverter GameImage = new PathImageConverter(); } </code></pre> <p>My PathImageConverter.cs</p> <pre><code>public class PathImageConverter : MvxBaseValueConverter { public override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return string.Format("squareresources/{0}.png", value.ToString().ToLower()); } } </code></pre> <p>My Setup.cs</p> <pre><code>public class Setup : MvxBaseAndroidBindingSetup { public Setup(Context applicationContext) : base(applicationContext) { } protected override MvxApplication CreateApp() { return new App(); } protected override IEnumerable&lt;Type&gt; ValueConverterHolders { get { return new[] { typeof(Converters.Converters) }; } } } </code></pre> <p>My GameView.axml</p> <pre><code>&lt;cirrious.mvvmcross.binding.android.views.MvxBindableGridView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res/MyZooSnap.UI" android:layout_width="fill_parent" android:layout_height="fill_parent" android:numColumns="4" android:verticalSpacing="10dp" android:horizontalSpacing="10dp" android:gravity="center" local:MvxItemTemplate="@layout/itemimage" local:MvxBind="{'ItemsSource':{'Path':'Items'}}" /&gt; </code></pre> <p>My ItemImage.axml</p> <pre><code>&lt;ImageView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res/MyZooSnap.UI" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp" local:MvxBind="{'AssetImagePath':{'Path':'PathImage', 'Converter':'GameImage'}}" </code></pre> <p>/></p> <p>My UI project :<img src="https://i.stack.imgur.com/JE8CD.jpg" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload