Beispiel #1
0
        private void ResetRootViewController()
        {
            var authManager = ServiceContainer.Resolve <AuthManager> ();

            if (authManager.IsAuthenticated)
            {
                if (ViewControllers.Length < 1 || ViewControllers [0] is WelcomeViewController)
                {
                    // Determine the default root view controller
                    UIViewController activeController;
                    var preferredView = ServiceContainer.Resolve <SettingsStore> ().PreferredStartView;
                    if (preferredView == "recent")
                    {
                        activeController = new RecentViewController();
                    }
                    else
                    {
                        activeController = new LogViewController();
                    }

                    SetViewControllers(new [] { activeController }, ViewControllers.Length > 0);
                }
            }
            else
            {
                if (ViewControllers.Length < 1 || !(ViewControllers [0] is WelcomeViewController))
                {
                    SetViewControllers(new [] { new WelcomeViewController() }, ViewControllers.Length > 0);
                }
            }
        }
Beispiel #2
0
            private Source(LogViewController controller, AllTimeEntriesView dataView) : base(controller.TableView, dataView)
            {
                this.controller = controller;
                this.dataView   = dataView;

                controller.TableView.RegisterClassForCellReuse(typeof(TimeEntryCell), EntryCellId);
                controller.TableView.RegisterClassForHeaderFooterViewReuse(typeof(SectionHeaderView), SectionHeaderId);
            }
Beispiel #3
0
        private void ResetRootViewController()
        {
            var authManager             = ServiceContainer.Resolve <AuthManager> ();
            UIViewController vc         = null;
            bool             emptyStack = ViewControllers.Length < 1;

            if (authManager.IsAuthenticated && (emptyStack || ViewControllers [0] is WelcomeViewController))
            {
                vc = new LogViewController();
            }
            else if (emptyStack || !(ViewControllers [0] is WelcomeViewController))
            {
                vc = new WelcomeViewController();
            }
            if (vc != null)
            {
                SetViewControllers(new [] { vc }, ViewControllers.Length > 0);
            }
        }
 public TimeEntriesSource(LogViewController owner, LogTimeEntriesViewModel viewModel) : base(owner.TableView, viewModel.Collection)
 {
     this.owner = owner;
     VM         = viewModel;
 }
Beispiel #5
0
 public Source(LogViewController controller) : this(controller, new AllTimeEntriesView())
 {
 }