Beispiel #1
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // Override point for customization after application launch.
            // If not required for your application you can safely delete this method
            Window = new UIWindow(UIScreen.MainScreen.Bounds);
            var storyboard = UIStoryboard.FromName("Main", NSBundle.MainBundle);
            UIViewController           rootViewController = null;
            FinancialProfileRepository repository         = new FinancialProfileRepository();
            var record = repository.Get(1);

            if (record.Answer == null || record.Answer == "")
            {
                rootViewController = (UIViewController)storyboard.InstantiateInitialViewController();//.InstantiateViewController("BirthdayController");
            }
            else
            {
                for (int i = 2; i < 6; i++)
                {
                    record = repository.Get(i);
                    if (record.Answer == null || record.Answer == "")
                    {
                        OtherQuestionController otherViewController = storyboard.InstantiateViewController("OtherQuestionController") as OtherQuestionController;
                        otherViewController.Id = i;
                        rootViewController     = otherViewController;
                        break;
                    }
                }
            }
            if (rootViewController == null)
            {
                rootViewController = (UIViewController)storyboard.InstantiateViewController("OverviewController");
            }
            Window.RootViewController = rootViewController;
            Window.MakeKeyAndVisible();
            return(true);
        }