Creating the Data Model and View Model

As discussed, we are going to pursue an MVVM approach to this application. Recall that this means a separation of concern between the objects that hold our data (the Model), the objects that display our data (the View), and the objects that glue the display and the data together (the ViewModel).

Because our model simply needs to store a few properties that represent the meal data we want to track, this is something safe and simple to add into the Shared project. Likewise, the ViewModel won’t implement any platform-specific logic, so it can live in the Shared project as well. To stay organized, we’ll create two new folders in the Shared project: DataModel and ViewModel. With the folders created, right-click ...

Get Microsoft Visual Studio 2015 Unleashed, Third Edition 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.