private void LaunchLoginSsoFlow()
        {
            var loginPage = new LoginSsoPage();
            var app       = new App.App(new AppOptions {
                IosExtension = true
            });

            ThemeManager.SetTheme(false, app.Resources);
            ThemeManager.ApplyResourcesToPage(loginPage);
            if (loginPage.BindingContext is LoginSsoPageViewModel vm)
            {
                vm.StartTwoFactorAction     = () => DismissViewController(false, () => LaunchTwoFactorFlow(true));
                vm.StartSetPasswordAction   = () => DismissViewController(false, () => LaunchSetPasswordFlow());
                vm.UpdateTempPasswordAction = () => DismissViewController(false, () => LaunchUpdateTempPasswordFlow());
                vm.SsoAuthSuccessAction     = () => DismissLockAndContinue();
                vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage());
            }

            var navigationPage  = new NavigationPage(loginPage);
            var loginController = navigationPage.CreateViewController();

            loginController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            PresentViewController(loginController, true, null);

            LogoutIfAuthed();
        }
Пример #2
0
        private void LaunchTwoFactorFlow(bool authingWithSso)
        {
            var twoFactorPage = new TwoFactorPage(authingWithSso);
            var app           = new App.App(new AppOptions {
                IosExtension = true
            });

            ThemeManager.SetTheme(false, app.Resources);
            ThemeManager.ApplyResourcesToPage(twoFactorPage);
            if (twoFactorPage.BindingContext is TwoFactorPageViewModel vm)
            {
                vm.TwoFactorAuthSuccessAction = () => DismissLockAndContinue();
                vm.StartSetPasswordAction     = () => DismissViewController(false, () => LaunchSetPasswordFlow());
                if (authingWithSso)
                {
                    vm.CloseAction = () => DismissViewController(false, () => LaunchLoginSsoFlow());
                }
                else
                {
                    vm.CloseAction = () => DismissViewController(false, () => LaunchLoginFlow());
                }
            }

            var navigationPage      = new NavigationPage(twoFactorPage);
            var twoFactorController = navigationPage.CreateViewController();

            twoFactorController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            PresentViewController(twoFactorController, true, null);
        }
        private void LaunchHomePage()
        {
            var homePage = new HomePage();
            var app      = new App.App(new AppOptions {
                IosExtension = true
            });

            ThemeManager.SetTheme(false, app.Resources);
            ThemeManager.ApplyResourcesToPage(homePage);
            if (homePage.BindingContext is HomeViewModel vm)
            {
                vm.StartLoginAction       = () => DismissViewController(false, () => LaunchLoginFlow());
                vm.StartRegisterAction    = () => DismissViewController(false, () => LaunchRegisterFlow());
                vm.StartSsoLoginAction    = () => DismissViewController(false, () => LaunchLoginSsoFlow());
                vm.StartEnvironmentAction = () => DismissViewController(false, () => LaunchEnvironmentFlow());
                vm.CloseAction            = () => CompleteRequest();
            }

            var navigationPage  = new NavigationPage(homePage);
            var loginController = navigationPage.CreateViewController();

            loginController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            PresentViewController(loginController, true, null);

            LogoutIfAuthed();
        }
        private async Task <bool> TryShowPage(MvxViewModelRequest request)
        {
            var page = MvxPresenterHelpers.CreatePage(request);

            if (page == null)
            {
                return(false);
            }

            var viewModel = MvxPresenterHelpers.LoadViewModel(request);

            if (_navigationPage == null)
            {
                Forms.Init();
                _navigationPage            = new NavigationPage(page);
                _window.RootViewController = _navigationPage.CreateViewController();
            }
            else
            {
                await _navigationPage.PushAsync(page);
            }

            page.BindingContext = viewModel;
            return(true);
        }
Пример #5
0
        private void NavigateToPage(ContentPage page)
        {
            var navigationPage = new NavigationPage(page);

            _currentModalController = navigationPage.CreateViewController();
            _currentModalController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            _presentingOnNavigationPage = true;
            PresentViewController(_currentModalController, true, null);
        }
        private void LaunchUpdateTempPasswordFlow()
        {
            var updateTempPasswordPage = new UpdateTempPasswordPage();
            var app = new App.App(new AppOptions { IosExtension = true });
            ThemeManager.SetTheme(app.Resources);
            ThemeManager.ApplyResourcesToPage(updateTempPasswordPage);
            if (updateTempPasswordPage.BindingContext is UpdateTempPasswordPageViewModel vm)
            {
                vm.UpdateTempPasswordSuccessAction = () => DismissViewController(false, () => LaunchHomePage());
                vm.LogOutAction = () => DismissViewController(false, () => LaunchHomePage());
            }

            var navigationPage = new NavigationPage(updateTempPasswordPage);
            var updateTempPasswordController = navigationPage.CreateViewController();
            updateTempPasswordController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            PresentViewController(updateTempPasswordController, true, null);
        }
        private void LaunchRegisterFlow()
        {
            var registerPage = new RegisterPage(null);
            var app = new App.App(new AppOptions { IosExtension = true });
            ThemeManager.SetTheme(app.Resources);
            ThemeManager.ApplyResourcesToPage(registerPage);
            if (registerPage.BindingContext is RegisterPageViewModel vm)
            {
                vm.RegistrationSuccess = () => DismissViewController(false, () => LaunchLoginFlow(vm.Email));
                vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage());
            }

            var navigationPage = new NavigationPage(registerPage);
            var loginController = navigationPage.CreateViewController();
            loginController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            PresentViewController(loginController, true, null);
        }
        private void LaunchEnvironmentFlow()
        {
            var environmentPage = new EnvironmentPage();
            var app = new App.App(new AppOptions { IosExtension = true });
            ThemeManager.SetTheme(app.Resources);
            ThemeManager.ApplyResourcesToPage(environmentPage);
            if (environmentPage.BindingContext is EnvironmentPageViewModel vm)
            {
                vm.SubmitSuccessAction = () => DismissViewController(false, () => LaunchHomePage());
                vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage());
            }

            var navigationPage = new NavigationPage(environmentPage);
            var loginController = navigationPage.CreateViewController();
            loginController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            PresentViewController(loginController, true, null);
        }
Пример #9
0
        public override void FinishedLaunching(UIApplication application)
        {
            Forms.Init ();

            Athena.ImagePicker.Pcl.App.Intitialise ();

            var navigationPage = new NavigationPage (new TestHarnessPage());
            var viewController = navigationPage.CreateViewController ();

            Window = new UIWindow (UIScreen.MainScreen.Bounds);

            Window.RootViewController = viewController;
            Window.MakeKeyAndVisible ();

            Athena.ImagePicker.Pcl.App.Register<IImagePickerProvider> (
                new ImagePickerProvider (Window.RootViewController),
                new ContainerControlledLifetimeManager());
        }
Пример #10
0
        public override void FinishedLaunching(UIApplication application)
        {
            Forms.Init();

            Athena.ImagePicker.Pcl.App.Intitialise();

            var navigationPage = new NavigationPage(new TestHarnessPage());
            var viewController = navigationPage.CreateViewController();

            Window = new UIWindow(UIScreen.MainScreen.Bounds);

            Window.RootViewController = viewController;
            Window.MakeKeyAndVisible();

            Athena.ImagePicker.Pcl.App.Register <IImagePickerProvider> (
                new ImagePickerProvider(Window.RootViewController),
                new ContainerControlledLifetimeManager());
        }
Пример #11
0
        private void LaunchSetPasswordFlow()
        {
            var setPasswordPage = new SetPasswordPage();
            var app             = new App.App(new AppOptions {
                IosExtension = true
            });

            ThemeManager.SetTheme(false, app.Resources);
            ThemeManager.ApplyResourcesToPage(setPasswordPage);
            if (setPasswordPage.BindingContext is SetPasswordPageViewModel vm)
            {
                vm.SetPasswordSuccessAction = () => DismissLockAndContinue();
                vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage());
            }

            var navigationPage        = new NavigationPage(setPasswordPage);
            var setPasswordController = navigationPage.CreateViewController();

            setPasswordController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            PresentViewController(setPasswordController, true, null);
        }
        public void PromptSSO()
        {
            var loginPage = new LoginSsoPage();
            var app       = new App.App(new AppOptions {
                IosExtension = true
            });

            ThemeManager.SetTheme(app.Resources);
            ThemeManager.ApplyResourcesToPage(loginPage);
            if (loginPage.BindingContext is LoginSsoPageViewModel vm)
            {
                vm.SsoAuthSuccessAction = () => DoContinue();
                vm.CloseAction          = Cancel;
            }

            var navigationPage  = new NavigationPage(loginPage);
            var loginController = navigationPage.CreateViewController();

            loginController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            PresentViewController(loginController, true, null);
        }
Пример #13
0
        private void LaunchLoginFlow(string email = null)
        {
            var loginPage = new LoginPage(email);
            var app       = new App.App(new AppOptions {
                IosExtension = true
            });

            ThemeManager.SetTheme(false, app.Resources);
            ThemeManager.ApplyResourcesToPage(loginPage);
            if (loginPage.BindingContext is LoginPageViewModel vm)
            {
                vm.StartTwoFactorAction = () => DismissViewController(false, () => LaunchTwoFactorFlow(false));
                vm.LogInSuccessAction   = () => DismissLockAndContinue();
                vm.CloseAction          = () => DismissViewController(false, () => LaunchHomePage());
            }

            var navigationPage  = new NavigationPage(loginPage);
            var loginController = navigationPage.CreateViewController();

            loginController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            PresentViewController(loginController, true, null);
        }
        private async Task<bool> TryShowPage(MvxViewModelRequest request)
        {
            var page = MvxPresenterHelpers.CreatePage(request);
            if (page == null)
                return false;

            var viewModel = MvxPresenterHelpers.LoadViewModel(request);

            if (_navigationPage == null)
            {
                Forms.Init();
                _navigationPage = new NavigationPage(page);
                _window.RootViewController = _navigationPage.CreateViewController();
            }
            else
            {
                await _navigationPage.PushAsync(page);
            }

            page.BindingContext = viewModel;
            return true;
        }
Пример #15
0
        private async Task ContinueOnAsync()
        {
            Tuple <SendType, string, byte[], string> createSend = null;

            if (_context.ProviderType == UTType.Data)
            {
                var(filename, fileBytes) = await LoadDataBytesAsync();

                createSend = new Tuple <SendType, string, byte[], string>(SendType.File, filename, fileBytes, null);
            }
            else if (_context.ProviderType == UTType.PlainText)
            {
                createSend = new Tuple <SendType, string, byte[], string>(SendType.Text, null, null, LoadText());
            }

            var appOptions = new AppOptions
            {
                IosExtension = true,
                CreateSend   = createSend,
                CopyInsteadOfShareAfterSaving = true
            };
            var sendAddEditPage = new SendAddEditPage(appOptions)
            {
                OnClose     = () => CompleteRequest(),
                AfterSubmit = () => CompleteRequest()
            };

            var app = new App.App(appOptions);

            ThemeManager.SetTheme(app.Resources);
            ThemeManager.ApplyResourcesToPage(sendAddEditPage);

            var navigationPage        = new NavigationPage(sendAddEditPage);
            var sendAddEditController = navigationPage.CreateViewController();

            sendAddEditController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            PresentViewController(sendAddEditController, true, null);
        }
 protected override void CustomPlatformInitialization(NavigationPage mainPage)
 {
     _window.RootViewController = mainPage.CreateViewController();
 }
Пример #17
0
 protected virtual void CustomPlatformInitialization(NavigationPage mainPage)
 {
     _window.RootViewController = mainPage.CreateViewController();
 }
Пример #18
0
 public void CreateMainController()
 {
     MainPage              = new NavigationPage(new MainPage());
     controller            = MainPage.CreateViewController();
     controller.View.Frame = new CGRect(0, 0, 300, 400);
 }