public override async void ViewDidAppear(bool didAppear) { ActivityIndicator.Hidden = false; ActivityIndicator.StartAnimating(); // Perform any additional setup after loading the view, typically from a nib. if (DataLayer.Instance.GetLocalBoxesSync().Count > 0) { var remoteExplorer = new RemoteExplorer(); try { List <Site> sites = await remoteExplorer.GetSites(); foreach (LocalBox box in DataLayer.Instance.GetLocalBoxesSync()) { for (int i = 0; i < sites.Count; i++) { if (box.BaseUrl == sites [i].Url) { sites.RemoveAt(i); break; } } } ActivityIndicator.StopAnimating(); ActivityIndicator.Hidden = true; _tableSource = new TableSource(sites); TableView.Source = _tableSource; TableView.ReloadData(); if (sites.Count == 0) { GeenSites.Hidden = false; if (_introduction) { ToevoegenButton.SetTitle("Verder", UIControlState.Normal); } } } catch (Exception ex) { Insights.Report(ex); DialogHelper.ShowErrorDialog("Fout", "Er is een fout opgetreden tijdens het ophalen van de sites."); } } }
public override async void ViewDidAppear(bool didAppear) { ActivityIndicator.Hidden = false; ActivityIndicator.StartAnimating (); // Perform any additional setup after loading the view, typically from a nib. if (DataLayer.Instance.GetLocalBoxesSync ().Count > 0) { var remoteExplorer = new RemoteExplorer (); try { List<Site> sites = await remoteExplorer.GetSites (); foreach (LocalBox box in DataLayer.Instance.GetLocalBoxesSync()) { for (int i = 0; i < sites.Count; i++) { if (box.BaseUrl == sites [i].Url) { sites.RemoveAt (i); break; } } } ActivityIndicator.StopAnimating (); ActivityIndicator.Hidden = true; _tableSource = new TableSource (sites); TableView.Source = _tableSource; TableView.ReloadData (); if (sites.Count == 0) { GeenSites.Hidden = false; if (_introduction) { ToevoegenButton.SetTitle("Verder", UIControlState.Normal); } } } catch (Exception ex) { Insights.Report (ex); DialogHelper.ShowErrorDialog ("Fout", "Er is een fout opgetreden tijdens het ophalen van de sites."); } } }