Beispiel #1
0
        /// <summary>
        /// A method that is called when the application starts.
        /// </summary>
        /// <param name="e">The <see cref="StartupEventArgs"/>.</param>
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            this.RegisterServices();

            this.mainViewModel = ViewModelContainer.Default.Resolve<MainDesktopViewModel>();
            IWindowService windowService = ViewModelContainer.Default.Resolve<IWindowService>();

            this.mainWindow = (Window)windowService.ShowWindow(this.mainViewModel);
            this.mainWindow.Closed += this.MainWindow_Closed;
        }
Beispiel #2
0
        /// <summary>
        /// A method that is called when the application starts.
        /// </summary>
        /// <param name="e">The <see cref="StartupEventArgs"/>.</param>
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            this.RegisterServices();

            this.mainViewModel = ViewModelContainer.Default.Resolve <MainDesktopViewModel>();
            IWindowService windowService = ViewModelContainer.Default.Resolve <IWindowService>();

            this.mainWindow         = (Window)windowService.ShowWindow(this.mainViewModel);
            this.mainWindow.Closed += this.MainWindow_Closed;
        }
Beispiel #3
0
        /// <summary>
        /// A method that is called when the application starts.
        /// </summary>
        /// <param name="e">The <see cref="StartupEventArgs"/>.</param>
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            // Setup service locator, ioc etc.
            WindowsViewModelLocator.EnsureInitialised();

            // Register window service (to be replaced by navigation and dialog services)
            SimpleIocWrapper.Default.Register <IWindowService, WpfWindowService>();
            WpfWindowService.RegisterWindow <MainDesktopViewModel, MainWindow>();

            this.mainViewModel = ServiceLocatorWrapper.Current.GetInstance <MainDesktopViewModel>();
            var windowService = ServiceLocatorWrapper.Current.GetInstance <IWindowService>();

            this.mainWindow         = (Window)windowService.ShowWindow(this.mainViewModel);
            this.mainWindow.Closed += this.MainWindow_Closed;
        }