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.
 }
Example #2
0
        public void TransitionWindow(INavigationWindow to)
        {
            to.SetDataContext(DataContext);
            to.ShowWindow();

            CloseWindow();
            provider.Window = to;
        }
Example #3
0
 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;
 }
Example #4
0
 public FileLoadViewModel(
     IOpenSaveFile fileDlg, IStartupData startup, INavigationWindow navigation,
     IList <IFileViewerFactory> factories)
 {
     this.fileDlg    = fileDlg;
     this.startup    = startup;
     this.navigation = navigation;
     this.factories  = factories;
 }
Example #5
0
 public RootNavigationWindow(INavigationWindow viewModel)
 {
     InitializeComponent();
     if (Dispatcher == null)
     {
         throw new InvalidProgramException("Dispatcher should not be null");
     }
     UiThreadBuilder.RunOnUiThread = Dispatcher.Invoke;
     DataContext = viewModel;
 }
Example #6
0
        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)));
        }
Example #7
0
        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);
        }
Example #8
0
        /// <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);
        }
Example #9
0
 protected virtual void NavigateWindow(NavigationViewModelBase navObject, INavigationWindow newWindow)
 {
     service.NavigateWithNewWindow(navObject, newWindow);
 }
Example #10
0
 public WindowEventArgs(INavigationWindow windowTo, INavigationWindow windowFrom = null)
 {
     WindowTo   = windowTo;
     WindowFrom = windowFrom;
 }
Example #11
0
 public DeploymentViewModel(INavigationWindow navigator, IRootViewModel model, IHasPassword password)
 {
     this.navigator = navigator;
     Model          = model;
     this.password  = password;
 }