public void DisplayFirstRun( )
        {
            ContainerViewController.RemoveFromParentViewController( );
            LoginViewController.RemoveFromParentViewController( );

            // display an error and return them to the first run screen.
            Rock.Mobile.Util.Debug.DisplayError(Strings.General_StartUp_Error_Header, Strings.General_StartUp_Error_Message);

            PresentViewController(FirstRunViewController, false, null);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            ImageCropViewController = new ImageCropViewController( );
            LoginViewController     = new LoginViewController(this);
            ContainerViewController = new ContainerViewController(this);
            FirstRunViewController  = new FirstRunViewController(this);

            // load any current cached config
            Config.Instance.LoadFromDevice( );

            // color it with whatever we currently have.
            if (Config.Instance.VisualSettings.TopHeaderBGColor != null && Config.Instance.VisualSettings.BackgroundColor != null)
            {
                ColorNavBar(Config.Instance.VisualSettings.TopHeaderBGColor);
                View.BackgroundColor = Theme.GetColor(Config.Instance.VisualSettings.BackgroundColor);
            }
            else
            {
                // if either of our colors are null, this is probably our first run, so just use black.

                ColorNavBar("#000000FF");
                View.BackgroundColor = Theme.GetColor("#000000FF");
            }

            // create a simple centered label (slightly above center, actually) that lets the user know we're trying to connect
            ConnectingLabel = new UILabel();
            ConnectingLabel.Layer.AnchorPoint = CGPoint.Empty;
            ConnectingLabel.Font      = ConnectingLabel.Font.WithSize(32);
            ConnectingLabel.Text      = "Connecting to Rock";
            ConnectingLabel.TextColor = Theme.GetColor("#6A6A6AFF");
            ConnectingLabel.SizeToFit( );
            ConnectingLabel.Layer.Position = new CGPoint((View.Bounds.Width - ConnectingLabel.Bounds.Width) / 2,
                                                         ((View.Bounds.Height - ConnectingLabel.Bounds.Height) / 2) - ConnectingLabel.Bounds.Height);
            View.AddSubview(ConnectingLabel);

            // show a spinner so the user feels like there's activity happening
            ProgressIndicator = new UIActivityIndicatorView();
            ProgressIndicator.Layer.AnchorPoint          = CGPoint.Empty;
            ProgressIndicator.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge;
            ProgressIndicator.Color = UIColor.Gray;
            ProgressIndicator.StartAnimating( );
            ProgressIndicator.Layer.Position = new CGPoint((View.Bounds.Width - ProgressIndicator.Bounds.Width) / 2, ConnectingLabel.Frame.Bottom + 30);
            View.AddSubview(ProgressIndicator);

            LockTimer = DateTime.Now;
        }