Beispiel #1
0
        private async void CheckInternetConnection()
        {
            if (BloggyConstant.CheckConnectivity() == false)
            {
                var msg = "No internet connection. Please check and try again";
                await Application.Current.MainPage.DisplayAlert("Connection Error", msg, "Cancel");

                return;
            }
        }
Beispiel #2
0
        private async void UpdateProfile(object obj)
        {
            if (string.IsNullOrEmpty(CurrentUser.Name))
            {
                string msg = "Blog name is required.";
                await Application.Current.MainPage.DisplayAlert("Error updating a profile", msg, "OK");

                return;
            }

            if (BloggyConstant.CheckConnectivity() == false)
            {
                var msg = "No internet connection. Please check and try again";
                await Application.Current.MainPage.DisplayAlert("Connection Error", msg, "Cancel");

                return;
            }

            try
            {
                if (CurrentUser != null && !string.IsNullOrEmpty(CurrentUser.Id))
                {
                    await BloggyServices.UpdateMemberAsync(CurrentUser, ImageArray);

                    // Messaging center update previous page
                    OnRefreshSettingsPage();
                    await Application.Current.MainPage.Navigation.PopAsync();
                }
            }
            catch (Exception ex)
            {
                var msg = "An error occured, Something went wrong";
                Console.WriteLine(ex.Message);
                await Application.Current.MainPage.DisplayAlert("Error", msg, "Cancel");

                return;
            }
        }