private void SetUiState(bool completed)
        {
            String instructions = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_5_instructions", null).PrepareForLabel();
            String confirmation = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_5_confirmation", null).PrepareForLabel();

            new System.Threading.Thread(new System.Threading.ThreadStart(() => {
                InvokeOnMainThread(() => {
                    if (!completed)
                    {
                        Log.Debug("calibration has not completed");
                        lblBody2.Text        = instructions;
                        btnCalibrate.Hidden  = false;
                        btnCalibrate.Enabled = true;
                    }
                    else
                    {
                        Log.Debug("calibration has completed");
                        lblBody2.Text        = confirmation;
                        lblBody2.Font        = UIFont.BoldSystemFontOfSize(16.0f);
                        lblBody2.TextColor   = StyleSettings.LightGrayColor();
                        btnCalibrate.Hidden  = true;
                        btnCalibrate.Enabled = false;
                    }
                });
            })).Start();
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // set UI
            backgroundView.Layer.CornerRadius = 10;
            backgroundView.Layer.BorderColor  = StyleSettings.LightGrayColor().CGColor;
            backgroundView.Layer.BorderWidth  = 1;
            horView.Layer.BackgroundColor     = StyleSettings.LightGrayColor().CGColor;
            vertView.Layer.BackgroundColor    = StyleSettings.LightGrayColor().CGColor;
            btnOk.SetTitle(NSBundle.MainBundle.LocalizedString("Vernacular_P0_dialog_accept", null), UIControlState.Normal);
            btnCancel.SetTitle(NSBundle.MainBundle.LocalizedString("Vernacular_P0_dialog_cancel", null), UIControlState.Normal);

            // set data model
            dataModel = SetDataModel(pickerType);

            // Set pickerview data model
            TypePickerViewModel model = new TypePickerViewModel();

            pickerView.Model = model;
            model.dataModel  = this.dataModel;
            pickerView.ShowSelectionIndicator = true;

            // set default selected row

            // btn handlers
            btnOk.TouchUpInside += (object sender, EventArgs e) => {
                SetSelectedType(pickerView.SelectedRowInComponent(0), this.pickerType);
                this.DismissViewController(true, () => {
                    SettingsVC.SetButtonTexts();
                });
            };

            btnCancel.TouchUpInside += (object sender, EventArgs e) => {
                this.DismissViewController(true, null);
            };
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Set Localized Strings
            String title = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_7_title", null).PrepareForLabel();

            lblTitle.Text = title;

            String body1 = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_7_text_1", null).PrepareForLabel();

            lblBody1.Text = body1;

            String body2 = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_7_text_2", null).PrepareForLabel();

            lblBody2.Text = body2;

            String btn = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_done", null).ToUpper().PrepareForLabel();

            btnGo.SetTitle(btn, UIControlState.Normal);

            String calibrationLabel = NSBundle.MainBundle.LocalizedString("Vernacular_P0_calibration_not_done", null);

            lblCalibration.Text   = calibrationLabel;
            lblCalibration.Hidden = false;

            // Set UI elements
            View.BackgroundColor     = StyleSettings.ThemePrimaryDarkLightenedColor();
            lblTitle.TextColor       = StyleSettings.ThemePrimaryColor();
            lblBody1.TextColor       = StyleSettings.TextOnDarkColor();
            lblBody2.TextColor       = StyleSettings.TextOnDarkColor();
            lblCalibration.TextColor = StyleSettings.LightGrayColor();
            btnGo.SetTitleColor(StyleSettings.TextOnDarkColor(), UIControlState.Normal);
            btnGo.Layer.CornerRadius = 5;
#if DEBUG
            btnGo.Enabled = true;
#else
            btnGo.Enabled = false;
#endif
            btnGo.BackgroundColor = StyleSettings.LightGrayColor();

            if (Settings.CalibrationDone)
            {
                btnGo.Enabled         = true;
                btnGo.BackgroundColor = StyleSettings.ThemePrimaryColor();
                lblCalibration.Hidden = true;
            }

            btnGo.TouchUpInside += (object sender, EventArgs e) => {
                if (NSUserDefaults.StandardUserDefaults.BoolForKey(PreferencesSettings.FirstLaunchKey))
                {
                    IntroVC.DismissViewController(true, null);
                }
                else
                {
                    NSUserDefaults.StandardUserDefaults.SetBool(true, PreferencesSettings.FirstLaunchKey);
                    var window = UIApplication.SharedApplication.KeyWindow;
                    window.RootViewController = new RootViewController();
                }
            };
        }