Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8680817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:20:47+00:00 2026-06-12T21:20:47+00:00

I create game using technology Mono. While writing, I have a problem. I need

  • 0

I create game using technology Mono. While writing, I have a problem. I need create a grid (4 to 5) with pictures. I thought to apply here GridLayout or GridView. But I do not know how to dynamically create images in GridLayout, which are updated with ViewModel (properties List ). During the game will change object properties SquareModel in List, namely the path to the image. If you click on the image, it will change.

A similar game I did ​​in Windows Phone. There did not have problems.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:20:49+00:00Added an answer on June 12, 2026 at 9:20 pm

    There is a GridView available in Android – but I’ve personally never used the GridView with databinding in mvvmcross – but I’ve heard it’s quite simple to add – see https://github.com/slodge/MvvmCross/issues/37

    As an alternative to the grid view, you could build your own Grid using some combination of vertical and horizontal LinearLayouts. You might do this by having an outer linearlayout like:

    <Mvx.MvxBindableLinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
        local:MvxItemTemplate="@layout/listitem_row"
        local:MvxBind="{'ItemsSource':{'Path':'Rows'}}"
      />
    

    with the row template containing

    <Mvx.MvxBindableLinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        local:MvxItemTemplate="@layout/listitem_cell"
        local:MvxBind="{'ItemsSource':{'Path':'Cells'}}"
      />
    

    and the cell containing just the ImageView


    Regardless of whether you use GridView or LinearLayouts, then you should be able to build a container ready for your individual ImageView squares.

    Once this is ready then changing the image shown in each square should be very straight-forward – it should just be a case of binding an ImageView’s AssetImagePath to a property on the ViewModel object representing the square.

    ie. if your ViewModel is:

    public class MyViewModel : MvxViewModel
    {
        public List<GameRow> Rows {get;private set;}
    }
    

    where GameRow is:

    public class GameRow : MvxNotifyProperty
    {
        public List<GameSquare> Cells {get;private set;}
    }
    

    where GameSquare is:

    public class GameSquare : MvxNotifyProperty
    {
        private string _icon;
        public string Icon 
        {
           get { return _icon; }
           set { _icon = value; RaisePropertyChanged(() => Icon);
        }
    }
    

    then the binding on each ImageView display should just be something like:

     {'AssetImagePath':{'Path':'Icon'}}
    

    Obviously you might not want to use icon paths directly in your ViewModel – you might prefer to use an enumeration instead. If you do this, then you might want to use a ValueConverter or a custom binding to display the correct image based on the current enumeration value.

    See the question and answer in how to bind an image src to resource drawable image with Mvvmcross? for some more information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a homework, where I need to create a winforms game using C#.
In my attempt to create my first 3D game using Ogre I started writing
I'm trying to create a game loop using this tutorial . I have tried
I am writing card game using Silverlight and HttpPollingDuplex . I have 4 seperate
I'm trying to create a grid for a game using the Moai SDK. Each
I am writing a game using C# and have found a number of cases
I'm programming an Android game using AndEngine. I want to create a circle which
I'm using the box2dflash library to create a game, and so far I've been
I am using Java to create a graphical game and every time I wish
I want to ask, is possible to create on-line card game, only with using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.