private async Task DeleteUserAccType(UserAccountTViewModel userAccount) { var a = ""; if (await _pageService.DisplayAlert("Warning", $"Are you sure you want to delete{userAccount.TypeAndName}?", "Yes", "No")) { UsersAccount.Remove(userAccount); var userAccountType = await _usersAccountTypeStore.GetUsersAccountType(userAccount.Id); await _usersAccountTypeStore.DeleteUserAccountType(userAccountType); } }
public UserAccountTypeDetailViewModel(UserAccountTViewModel viewModel, IUsersAccountTypeStore usersAccountTypeStore, IPageService pageService) { if (viewModel == null) { throw new ArgumentNullException(nameof(viewModel)); } _pageService = pageService; _usersAccountTypeStore = usersAccountTypeStore; SaveCommand = new Command(async() => await Save()); UsersAccount = new UsersAccountType { id = viewModel.Id, accountName = viewModel.AccountName, accountType = viewModel.AccountType }; }
private async Task SelectUserAccType(UserAccountTViewModel userAccount) { if (userAccount == null) { return; } SelectedUserAccountType = null; var viewModel = new UserAccountTypeDetailViewModel(userAccount, _usersAccountTypeStore, _pageService); viewModel.UserAccountTypeUpdated += (source, updateUserAccount) => { userAccount.Id = updateUserAccount.id; userAccount.AccountName = updateUserAccount.accountName; userAccount.AccountType = updateUserAccount.accountType; }; await _pageService.PushModalAsync(new UserAccountTypeDetailPage(viewModel)); }