I'm fairly new to development using Xamarin and MvvmCross, and am trying to port one of my windows apps to Android. It's a sliding puzzle game for children.
I was hoping I would be able use a list of Tiles as the ItemsSource for an MvxGridView. Each Tile object would have a Row and Column property to determine which "cell" (row/column) it would be placed in. Then, when the user taps a tile, I would be able to check if that tile is next to an empty space and, if so, change the corresponding Tile object's Row and Column properties. Because of the binding, the tile would then automatically be placed in the right "cell" in the grid, preferably using a nice sliding animation. I would like to use this type of solution because I would be able to put all the logic in viewmodel and model classes, instead of in the view. And it would be similar to the solution I used in my Windows store app, which would allow me to reuse a lot of code.
A long intro, but I hope it helps in understanding my questions. Is it possible to use the MvxGridView for this type of scenario? Or is there a different type of approach you would suggest with MvvmCross that would still allow me to keep the logic in viewmodel and model classes? If it's note too much too ask, a few code fragments would be really helpful.
I thought it might be possible by setting the android:layout_column and android:layout_row properties for a LinearLayout that is used as an ItemTemplate for an MvxGridView. I also read about using MvvmCross to bind layout_weight: How to bind to View's layout_weight in MvvmCross? However, I can't seem to find a way to access the layout_column and layout_row properties in the same way.
Thanks in advance for any help or suggestions you may be able to provide. I really like how the MvvmCross framework allows me to reuse many of my Windows store app programming skills. It would be great if I could use it for laying out the tiles in a grid, with or without the use of the MvxGridView.