Chapter 8. Building cross-platform view models

This chapter covers

  • Creating simple and master/detail view models
  • Adding state to view models using single-value and collection properties
  • Adding behavior to view models when properties change and using commands
  • Communicating between components using messaging
  • View-model navigation

In the previous chapter we built the cross-platform model layers for our two apps, SquareRt and Countr. We looked at how you can wrap up your model layer in services and repositories that can be shared among different view models. Now it’s time to move up a layer and start coding the view models.

8.1. The view-model layer

Like the model layer, the view-model layer is a cross-platform layer (figure 8.1). The difference ...

Get Xamarin in Action: Creating native cross-platform mobile apps now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.