//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); }
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); }
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); }
public void Initialize_should_populate_sub_view_models() { ScreenExtensions.TryActivate(_viewModel); Assert.Same(_entry, _subModel.Element); }
protected void Open(object model) { ScreenExtensions.TryActivate(model); }
internal override void OnActivate() { ScreenExtensions.TryActivate(ActiveItem); }
private static void ActivateRootObject(object rootObject) { ScreenExtensions.TryActivate(rootObject); }
public void WhenIOpenTheApplication() { ScenarioHelper.CreateRootObject(); StructureHelper.SetRootObject(ScenarioHelper.RootObject); ScreenExtensions.TryActivate(ScenarioHelper.RootObject); }
public override void ViewDidLoad() { base.ViewDidLoad(); ScreenExtensions.TryActivate(ViewModel); }
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(); } }
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(); } }
protected override void OnResume() { base.OnResume(); ScreenExtensions.TryActivate(viewModel); }
/// <inheritdoc /> public void Startup() { ScreenExtensions.TryActivate(this); }
/// <summary> /// Called when activating. /// </summary> protected override void OnActivate() { ScreenExtensions.TryActivate(this.ActiveItem); }
protected override void OnActivate() { base.OnActivate(); ScreenExtensions.TryActivate(ChildWindow); GotoLogin(); }