O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

TodoListViewModel

The TodoListViewModel constructor accepts an IDeviceProperties instance and an ITodoService instance, which, as you saw in Chapter 32, is used for storage and retrieval of to-do items. See the following excerpt:

public TodoListViewModel(    ITodoService todoService, IDeviceProperties deviceProperties){...    backupDatabaseCommand = new DelegateCommand(obj => BackupDatabase());    restoreDatabaseCommand = new DelegateCommand(obj => RestoreDatabase());    Load();}

The viewmodel contains a method that leverages the IDeviceProperties instance to create a unique ID to use to identify itself to calls to a WCF service.

string GetUserId(){    string id= deviceProperties.WindowsLiveAnonymousId; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required