protected override void OnStartup(object sender, StartupEventArgs e) { // Set custom namespace mappings. ViewLocator.AddNamespaceMapping("Jarvis.ViewModels.Settings", "Jarvis.Views.Settings"); // Initialize everything that needs to. var initializables = IoC.GetAll <IInitializable>(); foreach (var initializable in initializables) { initializable.Initialize(); } // Show the root view. var windowSettings = new Dictionary <string, object> { { "Visibility", Visibility.Hidden } }; DisplayRootViewFor <ShellViewModel>(windowSettings); Application?.MainWindow?.Hide(); // Create the taskbar icon. _taskbarIcon = IoC.Get <JarvisTaskbarIcon>(); // Start all background services. IoC.Get <ServiceOrchestrator>().Start(); // Register the hotkey. var service = IoC.Get <ApplicationService>(); _hotKey = new KeyboardHook(() => service.Toggle()); }
protected override void OnStartup(object sender, StartupEventArgs e) { // Show the root view. DisplayRootViewFor <ShellViewModel>(); Application?.MainWindow?.Hide(); // Create the taskbar icon. _taskbarIcon = IoC.Get <JarvisTaskbarIcon>(); // Start all background services. IoC.Get <ServiceOrchestrator>().Start(); // Register the hotkey. var service = IoC.Get <ApplicationService>(); _hotKey = new HotKey(() => service.Toggle()); }