//Note: may use here IntegrationTestsBaseWithActivation as well - package still not available.
 protected override TestConductorViewModel CreateRootObjectOverride(TestConductorViewModel rootObject)
 {
     ScreenExtensions.TryActivate(rootObject);
     return(rootObject);
 }
 protected override void OnActivate()
 {
     base.OnActivate();
     ScreenExtensions.TryActivate(ActiveItem);
 }
Example #3
0
 protected override ShellViewModel CreateRootObjectOverride(ShellViewModel rootObject)
 {
     ScreenExtensions.TryActivate(rootObject);
     return(rootObject);
 }
 public void Setup()
 {
     conductor = new BaseShell();
     ScreenExtensions.TryActivate(conductor);
 }
        public void TryActivateDoesNothingToNonIScreenState()
        {
            var screen = new Mock <IGuardClose>(MockBehavior.Strict);

            ScreenExtensions.TryActivate(screen.Object);
        }
Example #6
0
 public void OnNavigatedTo(FirstFloor.ModernUI.Windows.Navigation.NavigationEventArgs e)
 {
     ScreenExtensions.TryActivate(ViewModel);
 }
 public static void TryActivate(this object potentialActivatable)
 {
     ScreenExtensions.TryActivate(potentialActivatable);
 }
        public void Setup()
        {
            Init();

            ScreenExtensions.TryActivate(shell);
        }
Example #9
0
 public void Initialize_should_populate_sub_view_models()
 {
     ScreenExtensions.TryActivate(_viewModel);
     Assert.Same(_entry, _subModel.Element);
 }
Example #10
0
 protected void Open(object model)
 {
     ScreenExtensions.TryActivate(model);
 }
 internal override void OnActivate()
 {
     ScreenExtensions.TryActivate(ActiveItem);
 }
Example #12
0
 private static void ActivateRootObject(object rootObject)
 {
     ScreenExtensions.TryActivate(rootObject);
 }
Example #13
0
 public void WhenIOpenTheApplication()
 {
     ScenarioHelper.CreateRootObject();
     StructureHelper.SetRootObject(ScenarioHelper.RootObject);
     ScreenExtensions.TryActivate(ScenarioHelper.RootObject);
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            ScreenExtensions.TryActivate(ViewModel);
        }
Example #15
0
 protected override void OnActivate()
 {
     ScreenExtensions.TryActivate(this.LogView);
 }
        /// <summary>
        /// Called when activating.
        /// </summary>
        protected override void OnActivate()
        {
            base.OnActivate();

            ScreenExtensions.TryActivate(Conductor);
        }
 protected void Populate()
 {
     ViewModel.Loads(Element);
     ScreenExtensions.TryActivate(ViewModel);
 }
        public async Task ActivateAsync(object activationArgs)
        {
            if (IsInteractive(activationArgs))
            {
                // Initialize things like registering background task before the app is loaded
                await InitializeAsync();

                // Do not repeat app initialization when the Window already has content,
                // just ensure that the window is active
                if (Window.Current.Content == null)
                {
                    // Create a Frame to act as the navigation context and navigate to the first page
                    if (_shell?.Value == null)
                    {
                        var frame = new Frame();
                        NavigationService      = _container.RegisterNavigationService(frame);
                        Window.Current.Content = frame;
                    }
                    else
                    {
                        var viewModel = ViewModelLocator.LocateForView(_shell.Value);

                        ViewModelBinder.Bind(viewModel, _shell.Value, null);

                        ScreenExtensions.TryActivate(viewModel);

                        NavigationService      = _container.GetInstance <INavigationService>();
                        Window.Current.Content = _shell?.Value;
                    }

                    if (NavigationService != null)
                    {
                        NavigationService.NavigationFailed += (sender, e) =>
                        {
                            throw e.Exception;
                        };

                        NavigationService.Navigated += OnFrameNavigated;
                    }
                }
            }

            var activationHandler = GetActivationHandlers()
                                    .FirstOrDefault(h => h.CanHandle(activationArgs));

            if (activationHandler != null)
            {
                await activationHandler.HandleAsync(activationArgs);
            }

            if (IsInteractive(activationArgs))
            {
                var defaultHandler = new DefaultLaunchActivationHandler(_defaultNavItem, NavigationService);
                if (defaultHandler.CanHandle(activationArgs))
                {
                    await defaultHandler.HandleAsync(activationArgs);
                }

                // Ensure the current window is active
                Window.Current.Activate();

                // Tasks after activation
                await StartupAsync();
            }
        }
Example #19
0
        public async Task ActivateAsync(object activationArgs)
        {
            if (IsInteractive(activationArgs))
            {
                // Initialize services that you need before app activation
                // take into account that the splash screen is shown while this code runs.
                await InitializeAsync();

                // Do not repeat app initialization when the Window already has content,
                // just ensure that the window is active
                if (Window.Current.Content == null)
                {
                    // Create a Shell or Frame to act as the navigation context
                    if (_shell?.Value == null)
                    {
                        var frame = new Frame();
                        NavigationService      = _container.RegisterNavigationService(frame);
                        Window.Current.Content = frame;
                    }
                    else
                    {
                        var viewModel = ViewModelLocator.LocateForView(_shell.Value);

                        ViewModelBinder.Bind(viewModel, _shell.Value, null);

                        ScreenExtensions.TryActivate(viewModel);

                        NavigationService      = _container.GetInstance <INavigationService>();
                        Window.Current.Content = _shell?.Value;
                    }

                    if (NavigationService != null)
                    {
                        NavigationService.NavigationFailed += (sender, e) =>
                        {
                            throw e.Exception;
                        };
                    }
                }
            }

            var activationHandler = GetActivationHandlers()
                                    .FirstOrDefault(h => h.CanHandle(activationArgs));

            if (activationHandler != null)
            {
                await activationHandler.HandleAsync(activationArgs);
            }

            if (IsInteractive(activationArgs))
            {
                var defaultHandler = new DefaultActivationHandler(_defaultNavItem, NavigationService);
                if (defaultHandler.CanHandle(activationArgs))
                {
                    await defaultHandler.HandleAsync(activationArgs);
                }

                // Ensure the current window is active
                Window.Current.Activate();

                // Tasks after activation
                await StartupAsync();
            }
        }
Example #20
0
        protected override void OnResume()
        {
            base.OnResume();

            ScreenExtensions.TryActivate(viewModel);
        }
Example #21
0
 /// <inheritdoc />
 public void Startup()
 {
     ScreenExtensions.TryActivate(this);
 }
 /// <summary>
 /// Called when activating.
 /// </summary>
 protected override void OnActivate()
 {
     ScreenExtensions.TryActivate(this.ActiveItem);
 }
Example #23
0
 protected override void OnActivate()
 {
     base.OnActivate();
     ScreenExtensions.TryActivate(ChildWindow);
     GotoLogin();
 }