void ShowVisitorPicker()
 {
     visitorPicker = new VisitorPickerViewController
     {
         Visits   = MainPage.Visitors,
         Selected = async(visitor) =>
         {
             Visit.Visitor = visitor;
             navController.PopToRootViewController(true);
             visitorPicker = null;
         },
         CreateNew = ShowNewVisitor
     };
     navController.PushViewController(visitorPicker, true);
 }
Esempio n. 2
0
 /// <summary>登陆或者验证手势密码输入完成时的代理方法
 /// </summary>
 /// <param name="view"></param>
 /// <param name="type"></param>
 /// <param name="gesture">登陆时的手势密码</param>
 /// <param name="result"></param>
 public override void CircleViewDidCompleteSetSecondGesture(PCCircleView view, CircleViewType type, string gesture, bool equal)
 {
     //两次手势匹配
     if (equal)
     {
         msgLabel.ShowWarnMsg(PCCircleViewConst.gestureTextSetSuccess);
         navigationController.PopToRootViewController(true);
     }
     else
     {
         //两次手势不匹配
         msgLabel.ShowWarnMsgAndShake(PCCircleViewConst.gestureTextDrawAgainError);
         resetBtn.Hidden = false;
     }
 }
        private void OpenClicked(object sender, EventArgs e)
        {
            if (iPopover == null)
            {
                UINavigationController navigationController = new UINavigationController(iController);
                iRefreshButton  = new UIBarButtonItem(UIBarButtonSystemItem.Refresh);
                iEditButton     = new UIBarButtonItem(UIBarButtonSystemItem.Edit);
                iEditDoneButton = new UIBarButtonItem(UIBarButtonSystemItem.Done);
                navigationController.NavigationBar.TopItem.Title = iDefaultTitle;
                navigationController.NavigationBar.TopItem.RightBarButtonItem = iRefreshButton;
                navigationController.NavigationBar.TopItem.LeftBarButtonItem  = iEditButton;
                iPopover          = new UIPopoverController(navigationController);
                iPopover.Delegate = this;

                iRefreshButton.Clicked  += RefreshClicked;
                iEditButton.Clicked     += EditClicked;
                iEditDoneButton.Clicked += EditClicked;

                navigationController.PopToRootViewController(false);
                iPopover.SetPopoverContentSize(new SizeF(380, iPopover.PopoverContentSize.Height), true);
                iPopover.PresentFromBarButtonItem(iButton, UIPopoverArrowDirection.Any, true);
            }
            else
            {
                Dismiss();
            }
        }
Esempio n. 4
0
        private void OpenClicked(object sender, EventArgs e)
        {
            if (iPopover == null)
            {
                UINavigationController navigationController = new UINavigationController(iController);
                iRefreshButton = new UIBarButtonItem(UIBarButtonSystemItem.Refresh);
                navigationController.NavigationBar.TopItem.RightBarButtonItem = iRefreshButton;
                if (typeof(T) == typeof(Linn.Kinsky.Room))
                {
                    iButtonStandbyAll = new UIButton(new RectangleF(0, 0, 35, 30));
                    iButtonStandbyAll.SetImage(new UIImage("Standby.png"), UIControlState.Normal);
                    iButtonStandbyAll.SetImage(new UIImage("StandbyDown.png"), UIControlState.Highlighted);
                    iButtonStandbyAll.SetImage(new UIImage("StandbyOn.png"), UIControlState.Selected);
                    iButtonStandbyAll.SetBackgroundImage(new UIImage("UIBarButton.png"), UIControlState.Normal);
                    iButtonStandbyAll.TouchUpInside += StandbyAllClicked;

                    UIBarButtonItem barButton = new UIBarButtonItem();
                    barButton.CustomView = iButtonStandbyAll;
                    navigationController.NavigationBar.TopItem.LeftBarButtonItem = barButton;
                    UpdateStandbyAllButtonState();
                }
                iPopover          = new UIPopoverController(navigationController);
                iPopover.Delegate = this;

                iRefreshButton.Clicked += RefreshClicked;

                navigationController.PopToRootViewController(false);
                //iPopover.SetPopoverContentSize(new SizeF(320, 600), true);
                iPopover.PresentFromBarButtonItem(iButton, UIPopoverArrowDirection.Any, true);
            }
            else
            {
                Dismiss();
            }
        }
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // #1 Initialize
            Forms.Init();

            Shared  = this;
            _window = new UIWindow(UIScreen.MainScreen.Bounds);

            UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes
            {
                TextColor = UIColor.White
            });

            _weatherController = Storyboard.InstantiateInitialViewController() as ViewController;
            _navigation        = new UINavigationController(_weatherController);

            MessagingCenter.Subscribe <HistoryPage, string>(this, HistoryPage.HistoryItemSelected, (history, postalCode) =>
            {
                _navigation.PopToRootViewController(true);
                _weatherController.SetPostalCode(postalCode);
            });

            _window.RootViewController = _navigation;
            _window.MakeKeyAndVisible();

            return(true);
        }
        public override void ChangePresentation(MvxPresentationHint hint)
        {
            var closeHint = hint as MvxClosePresentationHint;

            if (closeHint != null)
            {
                if (_currentModal != null)
                {
                    ((UIViewController)_currentModal).DismissViewController(true, null);
                    return;
                }

                for (int i = _generalNavigationController.ViewControllers.Length - 1; i >= 1; i--)
                {
                    var vc        = _generalNavigationController.ViewControllers[i];
                    var touchView = vc as IMvxTouchView;
                    if (touchView != null && touchView.ViewModel == closeHint.ViewModelToClose)
                    {
                        _generalNavigationController.PopToViewController(_generalNavigationController.ViewControllers[i - 1], true);
                        return;
                    }
                }

                //If it didnt trigger above it's because it was probably the root.
                _generalNavigationController.PopToRootViewController(true);
            }
        }
Esempio n. 7
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            StampInstallDate();

            RxApp.DefaultExceptionHandler = Observer.Create((Exception e) =>
            {
                Locator.Current.GetService<IAlertDialogService>().Alert("Error", e.Message);
                Console.WriteLine("Exception occured: " + e.Message + " at " + e.StackTrace);
            });

            // Load the IoC
            Services.Registrations.InitializeServices(Locator.CurrentMutable);

            var viewModelViewService = Locator.Current.GetService<IViewModelViewService>();
            viewModelViewService.RegisterViewModels(typeof(IApplicationService).Assembly);
            viewModelViewService.RegisterViewModels(GetType().Assembly);

            // Install the theme
            SetupTheme();

            var startupViewController = new StartupViewController { ViewModel = new StartupViewModel(Locator.Current.GetService<IApplicationService>()) };
            startupViewController.ViewModel.View = startupViewController;

            var mainNavigationController = new UINavigationController(startupViewController) { NavigationBarHidden = true };
            MessageBus.Current.Listen<LogoutMessage>().Subscribe(_ =>
            {
                mainNavigationController.PopToRootViewController(false);
                mainNavigationController.DismissViewController(true, null);
            });

            Window = new UIWindow(UIScreen.MainScreen.Bounds) {RootViewController = mainNavigationController};
            Window.MakeKeyAndVisible ();
            return true;
        }
Esempio n. 8
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            StampInstallDate();

            RxApp.MainThreadScheduler     = new SynchronizationContextScheduler(SynchronizationContext.Current);
            RxApp.DefaultExceptionHandler = Observer.Create((Exception e) =>
            {
                IoC.Resolve <IAlertDialogService>().Alert("Error", e.Message);
                Console.WriteLine("Exception occured: " + e.Message + " at " + e.StackTrace);
            });

            // Load the IoC
            IoC.RegisterAssemblyServicesAsSingletons(typeof(Xamarin.Utilities.Core.Services.IDefaultValueService).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(typeof(Xamarin.Utilities.Services.DefaultValueService).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(typeof(Core.Services.IApplicationService).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(GetType().Assembly);

            var viewModelViewService = IoC.Resolve <IViewModelViewService>();

            viewModelViewService.RegisterViewModels(typeof(Xamarin.Utilities.Services.DefaultValueService).Assembly);
            viewModelViewService.RegisterViewModels(typeof(Core.Services.IApplicationService).Assembly);
            viewModelViewService.RegisterViewModels(GetType().Assembly);

            IoC.Resolve <IErrorService>().Init("http://sentry.dillonbuchanan.com/api/11/store/", "61105666362847a683ea7198ff6a1076 ", "7669a51402494220ab63e959851c19da");

            iRate.SharedInstance.AppStoreID                = 761416981;
            iRate.SharedInstance.ApplicationBundleID       = "com.dillonbuchanan.repositorystumble";
            iRate.SharedInstance.DaysUntilPrompt           = 2;
            iRate.SharedInstance.UsesUntilPrompt           = 5;
            iRate.SharedInstance.OnlyPromptIfLatestVersion = true;

            // Install the theme
            SetupTheme();

            //GitHubSharp.Client.ClientConstructor = () => new System.Net.Http.HttpClient(new ModernHttpClient.NativeMessageHandler());
            var startupViewController = new StartupViewController {
                ViewModel = IoC.Resolve <StartupViewModel>()
            };

            startupViewController.ViewModel.View = startupViewController;

            var mainNavigationController = new UINavigationController(startupViewController)
            {
                NavigationBarHidden = true
            };

            MessageBus.Current.Listen <LogoutMessage>().Subscribe(_ =>
            {
                mainNavigationController.PopToRootViewController(false);
                mainNavigationController.DismissViewController(true, null);
            });

            Window = new UIWindow(UIScreen.MainScreen.Bounds)
            {
                RootViewController = mainNavigationController
            };
            Window.MakeKeyAndVisible();
            return(true);
        }
Esempio n. 9
0
        public void OnSessionStateChanged(FBSession session, FBSessionState state, NSError error)
        {
            // FBSample logic
            // Any time the session is closed, we want to display the login controller (the user
            // cannot use the application unless they are logged in to Facebook). When the session
            // is opened successfully, hide the login controller and show the main UI.
            switch (state)
            {
            case FBSessionState.Open:
                this.mainViewController.StartLocationManager();
                if (loginViewController != null)
                {
                    navController.TopViewController.DismissViewController(true, null);
                    loginViewController = null;
                }

                // FBSample logic
                // Pre-fetch and cache the friends for the friend picker as soon as possible to improve
                // responsiveness when the user tags their friends.
                FBCacheDescriptor cacheDescriptor = FBFriendPickerViewController.CacheDescriptor();
                cacheDescriptor.PrefetchAndCacheForSession(session);
                break;

            case FBSessionState.Closed:
                // FBSample logic
                // Once the user has logged out, we want them to be looking at the root view.
                // and to clear the user Token
                if (navController.TopViewController.ModalViewController != null)
                {
                    navController.TopViewController.DismissViewController(false, null);
                }

                navController.PopToRootViewController(false);
                FBSession.ActiveSession.CloseAndClearTokenInformation();
                ShowLoginView();
                break;

            case FBSessionState.ClosedLoginFailed:
                // if the token goes invalid we want to switch right back to
                // the login view, however we do it with a slight delay in order to
                // account for a race between this and the login view dissappearing
                // a moment before
                this.ShowLoginView();
                break;

            default:
                break;
            }

            NSNotificationCenter.DefaultCenter.PostNotificationName(SCSessionStateChangedNotification, session);

            if (error != null)
            {
                UIAlertView alertView = new UIAlertView("Error: " + ((FBErrorCode)error.Code).ToString(), error.LocalizedDescription, null, "Ok", null);
                alertView.Show();
            }
        }
        public override void ClearBackStack()
        {
            if (_masterNavigationController == null)
            {
                return;
            }

            _masterNavigationController.PopToRootViewController(true);
            _masterNavigationController = null;
        }
Esempio n. 11
0
        /// <summary>
        /// Finished the launching.
        /// </summary>
        /// <param name="app">The app.</param>
        /// <param name="options">The options.</param>
        /// <returns>True or false.</returns>
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            #if DEBUG
            Locator.CurrentMutable.Register(() => new DiagnosticLogger(), typeof(ILogger));
            #endif

            // Stamp the date this was installed (first run)
            this.StampInstallDate("CodeHub", DateTime.Now.ToString());

            System.Net.ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;

            Locator.CurrentMutable.InitializeFactories();
            Locator.CurrentMutable.InitializeServices();
            CodeHub.Core.Bootstrap.Init();
            Locator.Current.GetService <IErrorService>().Init("http://sentry.dillonbuchanan.com/api/5/store/", "17e8a650e8cc44678d1bf40c9d86529b ", "9498e93bcdd046d8bb85d4755ca9d330");

            SetupPushNotifications();
            HandleNotificationOptions(options);

            var viewModelViews = Locator.Current.GetService <IViewModelViewService>();
            viewModelViews.RegisterViewModels(typeof(SettingsView).Assembly);

            Themes.Theme.Load("Default");

            var transitionOrchestration = Locator.Current.GetService <ITransitionOrchestrationService>();
            var serviceConstructor      = Locator.Current.GetService <IServiceConstructor>();
            var vm = serviceConstructor.Construct <StartupViewModel>();
            var startupViewController = new StartupView {
                ViewModel = vm
            };
            ((IRoutingViewModel)vm).RequestNavigation.Subscribe(x =>
            {
                var toViewType   = viewModelViews.GetViewFor(x.GetType());
                var toView       = serviceConstructor.Construct(toViewType) as IViewFor;
                toView.ViewModel = x;
                transitionOrchestration.Transition(startupViewController, toView);
            });

            var mainNavigationController = new UINavigationController(startupViewController)
            {
                NavigationBarHidden = true
            };
            MessageBus.Current.Listen <LogoutMessage>().Subscribe(_ =>
            {
                mainNavigationController.PopToRootViewController(false);
                mainNavigationController.DismissViewController(true, null);
            });

            Window = new UIWindow(UIScreen.MainScreen.Bounds)
            {
                RootViewController = mainNavigationController
            };
            Window.MakeKeyAndVisible();
            return(true);
        }
Esempio n. 12
0
 internal void ShowLoggedOut()
 {
     dvc.Root = new RootElement("Facebook Sample")
     {
         new Section("Facebook Connect Sample App")
         {
             new StringElement("Login to Facebook", Login)
         }
     };
     nav.PopToRootViewController(true);
 }
Esempio n. 13
0
        /// <summary>
        /// Finished the launching.
        /// </summary>
        /// <param name="app">The app.</param>
        /// <param name="options">The options.</param>
        /// <returns>True or false.</returns>
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
//			var iRate = MTiRate.iRate.SharedInstance;
//			iRate.AppStoreID = 707173885;


            // Stamp the date this was installed (first run)
            this.StampInstallDate("CodeHub", DateTime.Now.ToString());

            // Load the IoC
            IoC.RegisterAssemblyServicesAsSingletons(typeof(Xamarin.Utilities.Core.Services.IDefaultValueService).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(typeof(Xamarin.Utilities.Services.DefaultValueService).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(typeof(Core.Services.IApplicationService).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(GetType().Assembly);

            var viewModelViewService = IoC.Resolve <IViewModelViewService>();

            viewModelViewService.RegisterViewModels(typeof(Xamarin.Utilities.Services.DefaultValueService).Assembly);
            viewModelViewService.RegisterViewModels(GetType().Assembly);

            IoC.Resolve <IErrorService>().Init("http://sentry.dillonbuchanan.com/api/5/store/", "17e8a650e8cc44678d1bf40c9d86529b ", "9498e93bcdd046d8bb85d4755ca9d330");
            CodeHub.Core.Bootstrap.Init();


            Theme.Setup();
            SetupPushNotifications();
            HandleNotificationOptions(options);

            var startupViewController = new StartupView {
                ViewModel = IoC.Resolve <StartupViewModel>()
            };

            startupViewController.ViewModel.View = startupViewController;

            var mainNavigationController = new UINavigationController(startupViewController)
            {
                NavigationBarHidden = true
            };

            MessageBus.Current.Listen <LogoutMessage>().Subscribe(_ =>
            {
                mainNavigationController.PopToRootViewController(false);
                mainNavigationController.DismissViewController(true, null);
            });

            Window = new UIWindow(UIScreen.MainScreen.Bounds)
            {
                RootViewController = mainNavigationController
            };
            Window.MakeKeyAndVisible();
            return(true);
        }
Esempio n. 14
0
        /// <summary>
        /// Navigates back to the root view.
        /// </summary>
        public void BackToRoot()
        {
            this.EnsureCurrentController();

            UINavigationController navigationController = this.currentController.NavigationController;

            if (navigationController == null)
            {
                throw new InvalidOperationException("The current view is not currently presented as part of a navigation controller.");
            }

            navigationController.PopToRootViewController(true);
        }
Esempio n. 15
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            AppCenter.Start("394e3d5b-722a-4e2e-b465-24e0e7af82bf", typeof(Analytics), typeof(Crashes));

            StampInstallDate();

            RxApp.DefaultExceptionHandler = Observer.Create((Exception e) =>
            {
                Locator.Current.GetService <IAlertDialogService>().Alert("Error", e.Message);
                Console.WriteLine("Exception occured: " + e.Message + " at " + e.StackTrace);
            });

            // Load the IoC
            Services.Registrations.InitializeServices(Locator.CurrentMutable);

            var viewModelViewService = Locator.Current.GetService <IViewModelViewService>();

            viewModelViewService.RegisterViewModels(typeof(IApplicationService).Assembly);
            viewModelViewService.RegisterViewModels(GetType().Assembly);

            // Install the theme
            SetupTheme();

            var startupViewController = new StartupViewController {
                ViewModel = new StartupViewModel(Locator.Current.GetService <IApplicationService>())
            };

            startupViewController.ViewModel.View = startupViewController;

            var mainNavigationController = new UINavigationController(startupViewController)
            {
                NavigationBarHidden = true
            };

            MessageBus.Current.Listen <LogoutMessage>().Subscribe(_ =>
            {
                mainNavigationController.PopToRootViewController(false);
                mainNavigationController.DismissViewController(true, null);
            });

            Window = new UIWindow(UIScreen.MainScreen.Bounds)
            {
                RootViewController = mainNavigationController
            };
            Window.MakeKeyAndVisible();
            return(true);
        }
Esempio n. 16
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Perform any additional setup after loading the view, typically from a nib.

            tCancelClicked = delegate(object sender, EventArgs e) {
                _parent.SetCurrentJobStartedNone();
                _nav.PopToRootViewController(true);
            };
            tDoneClicked = delegate(object sender, EventArgs e) {
                _parent.SaveInfo_JobNotDone(NotDoneReason, this.tvComment.Text);
            };

            tbtnCancel.Clicked += tCancelClicked;
            tbtnDone.Clicked   += tDoneClicked;
        }
Esempio n. 17
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            var fonts = MakeFonts();

            window = new UIWindow(UIScreen.MainScreen.Bounds);
            dialog = new DialogViewController(fonts);
            var nav = new UINavigationController(dialog);

            window.RootViewController = nav;
            window.MakeKeyAndVisible();

            UIApplication.Notifications.ObserveContentSizeCategoryChanged(delegate {
                dialog.Root = MakeFonts();
                nav.PopToRootViewController(false);
            });
            return(true);
        }
Esempio n. 18
0
        // Is called by other apps from "open in" dialogs
        public override bool OpenUrl(UIApplication application, NSUrl url, string sourceApplication, NSObject annotation)
        {
            var sourceFile = url.Path;
            var destFile   = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), System.IO.Path.GetFileName(sourceFile));

            if (!File.Exists(sourceFile))
            {
                return(false);
            }

            var fileExists = false;

            if (File.Exists(destFile))
            {
                fileExists = true;
                File.Delete(destFile);
            }

            File.Copy(sourceFile, destFile);

            Cartridge cart = new Cartridge(destFile);

            CartridgeLoaders.LoadMetadata(new FileStream(destFile, FileMode.Open), cart);

            // TODO
            // If there was a cartridge with the same filename, than replace
            if (fileExists)
            {
            }

            if (window.RootViewController.PresentedViewController is UINavigationController && window.RootViewController.PresentedViewController == navCartSelect)
            {
                // Now create a new list for cartridges
                viewCartSelect = new CartridgeList(this);
                // Add the cartridge view to the navigation controller
                // (it'll be the top most screen)
                navCartSelect.PopToRootViewController(true);
                navCartSelect.SetViewControllers(new UIViewController[] { (UIViewController)viewCartSelect }, false);
//				CartridgeDetail cartDetail = new CartridgeDetail(this);
//				((UINavigationController)window.RootViewController.PresentedViewController).PushViewController (cartDetail,true);
//				cartDetail.Cartridge = cart;
            }

            return(true);
        }
Esempio n. 19
0
        private void InitializeSetting()
        {
            optionsController = (OptionsViewController)Global.FindViewController("OptionsViewController");
            optionsController.QueryEarthquakeResult = QueryEarthquakeResult;
            optionsController.OptionRowClick        = OptionRowClick;
            optionsController.PreferredContentSize  = new SizeF(420, 410);

            optionNavigationController = new UINavigationController(optionsController);
            optionNavigationController.PreferredContentSize = new SizeF(420, 410);

            baseTypeTableViewController          = new BaseMapTypeController();
            baseTypeTableViewController.RowClick = (view, path) =>
            {
                optionNavigationController.PopToRootViewController(true);
                DismissOptionController();
            };
            baseTypeTableViewController.DispalyBingMapKeyAlertView = ShowBingMapKeyAlertView;
        }
Esempio n. 20
0
        /// <summary>
        /// Finished the launching.
        /// </summary>
        /// <param name="app">The app.</param>
        /// <param name="options">The options.</param>
        /// <returns>True or false.</returns>
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
//			var iRate = MTiRate.iRate.SharedInstance;
//			iRate.AppStoreID = 707173885;


            // Stamp the date this was installed (first run)
            StampInstallDate();

            // Load the IoC
            IoC.RegisterAssemblyServicesAsSingletons(typeof(Xamarin.Utilities.Core.Services.IDefaultValueService).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(typeof(Xamarin.Utilities.Services.DefaultValueService).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(typeof(CodeFramework.Core.Services.IAccountsService).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(typeof(CodeFramework.iOS.Theme).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(typeof(Core.Services.IApplicationService).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(GetType().Assembly);

            var viewModelViewService = IoC.Resolve<IViewModelViewService>();
            viewModelViewService.RegisterViewModels(typeof(Xamarin.Utilities.Services.DefaultValueService).Assembly);
            viewModelViewService.RegisterViewModels(typeof(CodeFramework.iOS.Theme).Assembly);
            viewModelViewService.RegisterViewModels(GetType().Assembly);

            IoC.Resolve<IErrorService>().Init("http://sentry.dillonbuchanan.com/api/5/store/", "17e8a650e8cc44678d1bf40c9d86529b ", "9498e93bcdd046d8bb85d4755ca9d330");
            CodeHub.Core.Bootstrap.Init();


            Theme.Setup();
            SetupPushNotifications();
            HandleNotificationOptions(options);

            var startupViewController = new StartupView { ViewModel = IoC.Resolve<StartupViewModel>() };
            startupViewController.ViewModel.View = startupViewController;

            var mainNavigationController = new UINavigationController(startupViewController) { NavigationBarHidden = true };
            MessageBus.Current.Listen<LogoutMessage>().Subscribe(_ =>
            {
                mainNavigationController.PopToRootViewController(false);
                mainNavigationController.DismissViewController(true, null);
            });

            Window = new UIWindow(UIScreen.MainScreen.Bounds) {RootViewController = mainNavigationController};
            Window.MakeKeyAndVisible();
            return true;
        }
Esempio n. 21
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // Need it to startup!
            CodeStash.Core.Bootstrap.Init();

            Theme();

            // Load the IoC
            IoC.RegisterAssemblyServicesAsSingletons(typeof(Xamarin.Utilities.Core.Services.IDefaultValueService).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(typeof(Xamarin.Utilities.Services.DefaultValueService).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(typeof(CodeFramework.Core.Services.AccountsService).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(typeof(CodeFramework.iOS.Theme).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(typeof(Core.Services.IApplicationService).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(GetType().Assembly);

            var viewModelViewService = IoC.Resolve <IViewModelViewService>();

            viewModelViewService.RegisterViewModels(typeof(Xamarin.Utilities.Services.DefaultValueService).Assembly);
            viewModelViewService.RegisterViewModels(typeof(CodeFramework.iOS.Theme).Assembly);
            viewModelViewService.RegisterViewModels(GetType().Assembly);

            var startupViewController = new StartupView {
                ViewModel = IoC.Resolve <StartupViewModel>()
            };

            startupViewController.ViewModel.View = startupViewController;

            var mainNavigationController = new UINavigationController(startupViewController)
            {
                NavigationBarHidden = true
            };

            MessageBus.Current.Listen <LogoutMessage>().Subscribe(_ =>
            {
                mainNavigationController.PopToRootViewController(false);
                mainNavigationController.DismissViewController(true, null);
            });

            Window = new UIWindow(UIScreen.MainScreen.Bounds);
            Window.RootViewController = mainNavigationController;
            Window.MakeKeyAndVisible();
            return(true);
        }
Esempio n. 22
0
        private void GoToStartupView()
        {
            var serviceConstructor = Locator.Current.GetService <IServiceConstructor>();
            var vm = serviceConstructor.Construct <StartupViewModel>();
            var startupViewController = new StartupViewController {
                ViewModel = vm
            };

            var mainNavigationController = new UINavigationController(startupViewController)
            {
                NavigationBarHidden = true
            };

            MessageBus.Current.Listen <LogoutMessage>().Subscribe(_ => {
                mainNavigationController.PopToRootViewController(false);
                mainNavigationController.DismissViewController(true, null);
            });

            TransitionToViewController(mainNavigationController);
        }
Esempio n. 23
0
        public override bool OpenUrl(UIApplication app, NSUrl url, string sourceApp, NSObject annotation)
        {
            var rurl = new Rivets.AppLinkUrl(url.ToString());

            var id = string.Empty;

            if (rurl.InputQueryParameters.ContainsKey("id"))
            {
                id = rurl.InputQueryParameters ["id"];
            }

            if (rurl.InputUrl.Host.Equals("products") && !string.IsNullOrEmpty(id))
            {
                var c = new ProductViewController(id);
                navController.PushViewController(c, true);
                return(true);
            }
            else
            {
                navController.PopToRootViewController(true);
                return(true);
            }
        }
Esempio n. 24
0
 public override Task PopToRoot(bool animated)
 {
     MasterNavigationController.PopToRootViewController(animated);
     return(Task.CompletedTask);
 }
Esempio n. 25
0
 public void OrderCompleted()
 {
     navigation.PopToRootViewController(true);
     //TODO: display brag view
 }
 public void NavigateToRoot() => _navigationController.PopToRootViewController(false);
Esempio n. 27
0
 public void OrderCompleted()
 {
     navigation.PopToRootViewController(true);
 }
Esempio n. 28
0
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			var fonts = MakeFonts ();
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			dialog = new DialogViewController (fonts);
			var nav = new UINavigationController (dialog);
			window.RootViewController = nav;
			window.MakeKeyAndVisible ();

			UIApplication.Notifications.ObserveContentSizeCategoryChanged (delegate {
				dialog.Root = MakeFonts ();
				nav.PopToRootViewController (false);
			});
			return true;
		}
Esempio n. 29
0
        private void GoToStartupView()
        {
            var serviceConstructor = Locator.Current.GetService<IServiceConstructor>();
            var vm = serviceConstructor.Construct<StartupViewModel>();
            var startupViewController = new StartupViewController {ViewModel = vm};

            var mainNavigationController = new UINavigationController(startupViewController) { NavigationBarHidden = true };
            MessageBus.Current.Listen<LogoutMessage>().Subscribe(_ => {
                mainNavigationController.PopToRootViewController(false);
                mainNavigationController.DismissViewController(true, null);
            });

            TransitionToViewController(mainNavigationController);
        }