//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);
 }
Exemplo n.º 3
0
 protected override ShellViewModel CreateRootObjectOverride(ShellViewModel rootObject)
 {
     ScreenExtensions.TryActivate(rootObject);
     return(rootObject);
 }
 public void Setup()
 {
     conductor = new BaseShell();
     ScreenExtensions.TryActivate(conductor);
 }
Exemplo n.º 5
0
        public void TryActivateDoesNothingToNonIScreenState()
        {
            var screen = new Mock <IGuardClose>(MockBehavior.Strict);

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

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

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

            ScreenExtensions.TryActivate(Conductor);
        }
Exemplo n.º 17
0
 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();
            }
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 20
0
        protected override void OnResume()
        {
            base.OnResume();

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