private bool CheckInternet() { OnProcessMessage(contentUI.TxtProcessCheckInternet); var isHasInternet = AppMobileService.Network.IsAvailable(); if (!isHasInternet) { ViewPage.DisplayAlert(contentUI.TitleErrInternet, contentUI.MsgErrInternet, contentUI.TxtOk); ProcessMessage = contentUI.TxtRertyCheckInternet; IsRetry = true; } return(isHasInternet); }
internal void BtnLocation_Click(object sender, EventArgs e) { (ViewPage as MainPage).MapLocation.CloseDetailInfo(); if (AppMobileService.Locaion.IsAvailable()) { AppMobileService.Locaion.UpdateCurrentLocation(); if ((AppMobileService.Locaion.CurrentLocation.Latitude != 0) && (AppMobileService.Locaion.CurrentLocation.Longitude != 0)) { (ViewPage as MainPage).MapLocation.MoveToRegion(MapSpan.FromCenterAndRadius( new Position(AppMobileService.Locaion.CurrentLocation.Latitude, AppMobileService.Locaion.CurrentLocation.Longitude), Distance.FromKilometers(2))); } } else { ViewPage.DisplayAlert(contentUI.MsgTitleNoGPS, contentUI.MsgTxtNoGPS, contentUI.TxtOk); } }
async private void InitApp() { IsShowLoading = true; if (CheckInternet()) { if (!await AppData.Discount.LoadData(OnProcessMessage)) { ProcessMessage = contentUI.TitleErrLoading; await ViewPage.DisplayAlert(contentUI.TitleErrLoading, contentUI.MsgErrLoading, contentUI.TxtOk); ProcessMessage = contentUI.TxtErrServiceConnection; IsRetry = true; return; } ProcessMessage = ""; //await Task.Delay(3000);//for fun, i will del it MessagingCenter.Send(this, "StartMainForm"); } IsShowLoading = false; }