private void UpdateGUI(bool isNetworkConnected = true) { Deployment.Current.Dispatcher.BeginInvoke(() => { if (isNetworkConnected) { if (!Convert.ToBoolean(App.MegaSdk.isLoggedIn())) { NavigateService.NavigateTo(typeof(MainPage), NavigationParameter.None); return; } _contactsViewModel.SetEmptyContentTemplate(true); _contactsViewModel.GetMegaContacts(); _contactsViewModel.GetReceivedContactRequests(); _contactsViewModel.GetSentContactRequests(); } else { _contactsViewModel.MegaContactsList.Clear(); _contactsViewModel.ReceivedContactRequests.Clear(); _contactsViewModel.SentContactRequests.Clear(); _contactsViewModel.SetOfflineContentTemplate(); } SetApplicationBarData(isNetworkConnected); }); }