public RootViewModel(INavigationWindow navWindow, IYokeConnection yoke, SimServer server) { Server = server; this.navWindow = navWindow; // Yoke and server are singletons, we demand that they exist at this point and then // the IOC framework will keep the active. }
public void TransitionWindow(INavigationWindow to) { to.SetDataContext(DataContext); to.ShowWindow(); CloseWindow(); provider.Window = to; }
public FileLoadViewModel(IOpenSaveFile fileDlg, IStartupData startup, IRootModelFactory modelFactory, Func <RootModel, RootViewModel> viewModelFactory, INavigationWindow navigation) { this.fileDlg = fileDlg; this.startup = startup; this.modelFactory = modelFactory; this.viewModelFactory = viewModelFactory; this.navigation = navigation; }
public FileLoadViewModel( IOpenSaveFile fileDlg, IStartupData startup, INavigationWindow navigation, IList <IFileViewerFactory> factories) { this.fileDlg = fileDlg; this.startup = startup; this.navigation = navigation; this.factories = factories; }
public RootNavigationWindow(INavigationWindow viewModel) { InitializeComponent(); if (Dispatcher == null) { throw new InvalidProgramException("Dispatcher should not be null"); } UiThreadBuilder.RunOnUiThread = Dispatcher.Invoke; DataContext = viewModel; }
public void UploadPackages(INavigationWindow nav) { var files = Model.Files .Where(i => i.Deploy) .Select(i => i.Package(Model.Version)) .OfType <IFile>() .ToList(); nav.NavigateTo(new ConsoleWindowViewModel(new NugetDeploymentCommands(this, files))); }
protected override void NavigateWindow(NavigationViewModelBase navObject, INavigationWindow newWindow) { if (navObject is AuthorizedViewModel authVM) { if (VerifyNavigation(authVM)) { base.Navigate(navObject); return; } base.NavigateWindow(service.DefaultNavigation, new LoginWindow()); return; } base.NavigateWindow(navObject, newWindow); }
/// <summary> /// Navigate to a ViewModel with a new window /// </summary> /// <param name="navObject">ViewModel to navigate to</param> /// <param name="newWindow">Window to navigate to</param> public void NavigateWithNewWindow(NavigationViewModelBase navObject, INavigationWindow newWindow) { if (Provider == null) { throw new NullReferenceException("The navigation service does not have a registered 'ISimpleNavigationProvider'"); } var args = new WindowEventArgs(newWindow, Provider.Window); Navigate(navObject); OnBeforeClosing(this, args); Provider.Window.TransitionWindow(newWindow); OnAfterClosing(this, args); }
protected virtual void NavigateWindow(NavigationViewModelBase navObject, INavigationWindow newWindow) { service.NavigateWithNewWindow(navObject, newWindow); }
public WindowEventArgs(INavigationWindow windowTo, INavigationWindow windowFrom = null) { WindowTo = windowTo; WindowFrom = windowFrom; }
public DeploymentViewModel(INavigationWindow navigator, IRootViewModel model, IHasPassword password) { this.navigator = navigator; Model = model; this.password = password; }