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 void AddChildren(ReferenceDescriptionCollection srcRef) { foreach (var r in srcRef) { var child = new OPCUAReference(this.client, this, this.EventAggregator) { DisplayName = r.DisplayName.ToString(), NodeId = r.NodeId, Type = r.NodeClass, }; this.Children.Add(child); } }
public OPCUAReference(Interfaces.IReferenceFetchable client, OPCUAReference parent, IEventAggregator ea) { this.client = client; this.Parent = parent; this.EventAggregator = ea; this.children = new ObservableCollection <OPCUAReference>(); BindingOperations.EnableCollectionSynchronization(this.children, new object()); this.children.Add(DummyChild); this.DisplayName = ""; }