protected async override void OnAppearing() { try { base.OnAppearing(); Settings.TypedMessage = null; if (Application.Current.Properties.ContainsKey("USERID")) { userId = Convert.ToString(Application.Current.Properties["USERID"]); } if (NetworkCheck.IsInternet()) { ViewModel = new MessageViewModel(); this.BindingContext = ViewModel; await ViewModel.FetchData(); ViewModel._helper = this; } else { await DisplayAlert("Simon", "No network is available.", "OK"); } } catch (Exception ex) { await DisplayAlert("Exception", ex.Message, "OK"); } }