public AccountCreateViewModel(IStorage<PicasaAccount> accountStorage, INavigationService navigationService) { _accountStorage = accountStorage; _navigationService = navigationService; Account = new PicasaAccount(); }
public void Delete(PicasaAccount account) { var list = storageHelper.GetList<PicasaAccount>(); var storageAccount = list.SingleOrDefault(a => a.User == account.User); if (storageAccount != null) { list.Remove(storageAccount); } storageHelper.SaveList<PicasaAccount>(list); }
public void DeleteAccount(PicasaAccount account) { var message = String.Format("Are you sure want to delete \"{0}\"?", account.User); var result = MessageBox.Show(message, "Confirmation", MessageBoxButton.OKCancel); if (result == MessageBoxResult.OK) { AccountList.Remove(account); _accountStorage.SaveList(AccountList); AccountList = new List<PicasaAccount>(AccountList); NotifyOfPropertyChange(() => AccountList); } }
public void Add(PicasaAccount account) { var list = storageHelper.GetList<PicasaAccount>(); list.Add(account); storageHelper.SaveList<PicasaAccount>(list); }
/// <summary> /// Navigate to picasa albums list /// </summary> public void Navigation_PicasaAlbumListView(PicasaAccount account) { if (account != null) { //TODO: error handler. Handle auth error _photoService.Login(account.User, account.Password, (auth) => _navigationService.Navigate(UrlHelper.PicasaAlbumList())); } }