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; ...
Get Windows® Phone 8 Unleashed 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.