Greg Mercer (1) [Avatar] Offline
[ 922 bytes ]
I've really found the book very useful, and it comes at a perfect time for our project. So first off... thanks very much for a great book Jim!

I have been experimenting a bit with the Countr example... and at the moment I've only specifically made changes to the iOS portion.

I wanted to see what it would be like to add something that would show a detailed page when an item was selected. Now mind you I've really only got the show "CounterViewModel" working at the moment. And there are certainly some issues with what I got working so far but... I've uploaded the code up to this point just to share.

I haven't tried yet to understand how to get this working for Droid, but I think this might be a useful feature to add to Countr app example in the book.

Anywayz thanks again Jim.
Jim Bennett (82) [Avatar] Offline
Hi Greg,

Thanks for your feedback, and I'm glad you are finding the book useful.

I agree that it would be a useful example to add, and was something I was thinking about adding but unfortunately there is only so much space in a book so I left it out. It's good feedback though - if others agree that it would be a useful example then I'll either add it to the book, or make it available as an appendix. The curse of books - making sure the content is useful to everyone without it being too big!

What you've done is correct - create the command and bind it so that all the logic is in the cross platform layers. The only change to make is in the service. The AddCounter method just takes a name and builds a counter from it, but you could always change it to always take a counter from the CounterViewmodel and save that. This would save a new counter as a new row or overwrite the existing one based off the auto incrementing ID without you having to make any other changes - the repository uses InsertOrReplaceAsync to update the SQLite database so handles both new counters and updates.

On Android it's easy to wire up the command - just add the item selected command to your recycler view binding in the AXML:

local:MvxBind="ItemsSource Counters; ItemClick ItemSelectedCommand"

Let me know how you go and if I can provide any more help.

280471 (2) [Avatar] Offline
Jim, First, what a great book! I would find it helpful if there were a few minor (to me) additions:
1) More visuals of the what the code will be doing in the app. This would be especially useful as you get into the later chapters and begin introducing more complex UI topics.
2) Representations of the visuals in multiple platforms. Xamarin allows for the building to be in many different UIs. The samples start out building a solution, and when I followed along at the beginning I ended up with a solution containing:
- Andoid
- iOS
- tvOS
3) Since I can't search on the epub when referencing it in the Google Play Books reader, or the Mobi in the Kindle, an additional Appendix that would be focused on: IFTTT
- If you want to do this, then you need to build / include that
4) Lastly some really complex views pull in a Xamarin / MvvmCross plugin or two, to really demonstrate the power of Xamarin in Action
280471 (2) [Avatar] Offline
Just an FYI the source code in the Chapter 10 folder Countr.iOS is referencing FirstViewModel from the Countr.Core. The ViewModel no longer exists. This is an example of the iOS being out of sync with the android. smilie
Additionally, there is no UWP and WCF projects in the application.