Updating the data model


show more Updating the data model provides you with in-depth training on Developer. Taught by Michael Lehman as part of the Windows Phone SDK Essential Training show less
please wait ...

Updating the data model

Surprise, surprise! Here we find ourselves in Visual Studio again. Let's update the data model now to have it access to database to do the querying to build our initial set of items and to implement the logic we need for the details page. So move over here is the Solution Explorer, open up the MainViewModel.cs, and put our new version in and see what we've changed. To start with, we have a local intense variable, we're going to hold the Sonnets dbDataContext.

And in our MainViewModel Constructor we're going ask the App class for the instances of the database that we've created there. Also as we did before, we're going to create art to ObservableCollection of ItemsViewModels for items and favorite items. All that remains the same. What's going to change now is the logic inside load data. So instead of looking at the data that we got from XML--which is what we did before--we're simply going to query the database for the Sonnets.

So the way you do queries using the SQL...

Updating the data model
Video duration: 2m 24s 4h 34m Beginner

Viewers:

Updating the data model provides you with in-depth training on Developer. Taught by Michael Lehman as part of the Windows Phone SDK Essential Training

Subject:
Developer
Software:
Windows Phone
Author:
please wait ...