public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            if (_introduction)
            {
                View.AddSubview(_home.GetIntroductionProgressView(1));

                RegistrationExplanation.Hidden = false;
                TopMenu.Hidden = true;

                BottomMenu.BackgroundColor     = null;
                DarkBackground.BackgroundColor = null;

                ToevoegenButton.SetImage(UIImage.FromFile("IcBottom-Opslaan-Wit.png"), UIControlState.Normal);
                ToevoegenButton.SetTitleColor(UIColor.White, UIControlState.Normal);
            }

            ActivityIndicator.Hidden = true;

            GeenSites.Hidden = true;

            CancelButton.TouchUpInside += async(o, e) => {
                this.View.RemoveFromSuperview();
            };

            ToevoegenButton.TouchUpInside += async(o, e) => {
                if (DataLayer.Instance.GetLocalBoxesSync().Count > 0)
                {
                    try {
                        var localBox = DataLayer.Instance.GetSelectedOrDefaultBox();
                        foreach (Site site in _tableSource.selectedItems)
                        {
                            LocalBox box = new LocalBox();
                            box.BackColor = localBox.BackColor;
                            box.BaseUrl   = site.Url;
                            box.DatumTijdTokenExpiratie = localBox.DatumTijdTokenExpiratie;
                            box.LogoUrl = localBox.LogoUrl;
                            box.Name    = site.Name;
                            box.OriginalServerCertificate = null;
                            box.PassPhrase = null;
                            box.PrivateKey = null;
                            box.PublicKey  = null;
                            box.User       = localBox.User;
                            DataLayer.Instance.AddOrUpdateLocalBox(box);
                        }

                        _home.InitialiseMenu();
                        this.View.RemoveFromSuperview();
                    }catch (Exception ex) {
                        Insights.Report(ex);
                    }
                }
            };
        }
        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.");
                }
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (GeenSites != null)
            {
                GeenSites.Dispose();
                GeenSites = null;
            }

            if (ActivityIndicator != null)
            {
                ActivityIndicator.Dispose();
                ActivityIndicator = null;
            }

            if (BottomMenu != null)
            {
                BottomMenu.Dispose();
                BottomMenu = null;
            }

            if (CancelButton != null)
            {
                CancelButton.Dispose();
                CancelButton = null;
            }

            if (DarkBackground != null)
            {
                DarkBackground.Dispose();
                DarkBackground = null;
            }

            if (OKButton != null)
            {
                OKButton.Dispose();
                OKButton = null;
            }

            if (RegistrationExplanation != null)
            {
                RegistrationExplanation.Dispose();
                RegistrationExplanation = null;
            }

            if (TableView != null)
            {
                TableView.Dispose();
                TableView = null;
            }

            if (ToevoegenButton != null)
            {
                ToevoegenButton.Dispose();
                ToevoegenButton = null;
            }

            if (TopMenu != null)
            {
                TopMenu.Dispose();
                TopMenu = null;
            }
        }