private void Application_Startup(object sender, StartupEventArgs e) { this.RegisterErrorHandler(); Jupiter.Properties.Settings.Default.Upgrade(); ViewModelLocationProvider.SetDefaultViewModelFactory(x => this.Container.Resolve(x)); var lifetimeManager = new ContainerControlledLifetimeManager(); var lifetimeManager2 = new ContainerControlledLifetimeManager(); var lifetimeManager3 = new ContainerControlledLifetimeManager(); var lifetimeManager4 = new ContainerControlledLifetimeManager(); var ea = new Prism.Events.EventAggregator(); this.Container.RegisterInstance <Prism.Events.IEventAggregator>(ea); this.Container.RegisterType <Interfaces.INodeTreeModel, Models.NodeTreeModel>(lifetimeManager); this.Container.RegisterType <Interfaces.INodeInfoDataGrid, Models.NodeInfoDataGridModel>(lifetimeManager2); this.Container.RegisterType <Interfaces.ISubscriptionModel, Models.SubscriptionModel>(lifetimeManager3); this.Container.RegisterType <Interfaces.IOneTimeAccessModel, Models.OneTimeAccessModel>(lifetimeManager4); var c = new Client(ea); this.Container.RegisterInstance <Interfaces.IConnection>(c); this.Container.RegisterInstance <Interfaces.IReferenceFetchable>(c); this.Container.RegisterInstance <Interfaces.INodeInfoGetter>(c); this.Container.RegisterInstance <Interfaces.ISubscriptionOperatable>(c); this.Container.RegisterInstance <Interfaces.IOneTimeAccessOperator>(c); var references = new OPCUAReference(c, null, ea); this.Container.RegisterInstance <Interfaces.IReference>(references); this.Container.Resolve <Views.MainWindow>().Show(); }
public MainNavigationPageViewModel(Prism.Events.EventAggregator ea) { PropertyName = "Blue"; ea.GetEvent <ColorChangeEvent>().Subscribe((col) => { PropertyName = col; }); }
public Page4ViewModel(INavigationService navigationService, Prism.Events.EventAggregator ea) { ea.GetEvent <ColorChangeEvent>().Publish("Black"); GoHomePageCommand = new DelegateCommand(async() => { await navigationService.NavigateAsync("any:///MainNavigationPage/MainPage"); }); }
public void CreateSessionExceptionCheck() { var connection = new TestConnection(); var ea = new Prism.Events.EventAggregator(); var msg = ""; ea.GetEvent <Jupiter.Events.ErrorNotificationEvent>() .Subscribe(x => msg = x.Message); connection.Exception = true; var model = new Jupiter.Models.ConnectionModel(connection); model.EventAggregator = ea; model.ConnectCommand.Execute(null); Assert.AreEqual(msg, "CreateSessionException"); }
public App() { InitializeComponent(); EventAggregator = new Prism.Events.EventAggregator(); }
public App() { InitializeComponent(); EventAggregator = new Prism.Events.EventAggregator(); }