Example #1
0
        public async void Delete(object obj)
        {
            bool answer = await userProfilePage.DisplayAlert("Are you sure?", "All coupons will be lost", "ok", "cancel");

            if (answer)
            {
                IsBusy         = true;
                LoadingMessage = "Deleting...";

                BAMAppUser user = await ServiceLocator.AzureService.GetById <BAMAppUser>(Settings.UserId);

                await ServiceLocator.AzureService.Delete(user);

                await ServiceLocator.AuthenticationService.LogoutAsync(
                    ServiceLocator.AzureService.MobileService);

                userProfilePage.Navigation.InsertPageBefore(new SignInPage(), userProfilePage.Navigation.NavigationStack.First());
                await userProfilePage.Navigation.PopToRootAsync();
            }

            IsBusy = false;
        }