protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog) { base.ConfigureModuleCatalog(moduleCatalog); moduleCatalog.AddModule <InfrastructureModule>(); moduleCatalog.AddModule <UiCommonModule>(); moduleCatalog.AddModule <WindowUiModule>(); #if MSIX_RELEASE moduleCatalog.AddModule <NotificationsW8Module>(InitializationMode.OnDemand); NotificationsModuleLoader.SetModule(nameof(NotificationsW8Module)); #else moduleCatalog.AddModule <NotificationsWpfModule>(InitializationMode.OnDemand); NotificationsModuleLoader.SetModule(nameof(NotificationsWpfModule)); #endif }
public Shell() { InitializeComponent(); System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon(); using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream( "Application." + "wtmico.ico")) { ni.Icon = new Icon(stream); } ni.Visible = true; ni.Click += delegate { ShowWindow(); }; ni.Text = "WTM"; System.Windows.Application.Current.ShutdownMode = ShutdownMode.OnMainWindowClose; var ea = ServiceLocator.Current.GetInstance <IEventAggregator>(); ea.GetEvent <ShowWindowEvent>() .Subscribe(() => { ShowWindow(); }, true); ea.GetEvent <LoadNotificationsModuleEvent>() .Subscribe(() => { var m = ServiceLocator.Current.GetInstance <IModuleManager>(); NotificationsModuleLoader.Load(m); }); }