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 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.