private void Vm_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName.Equals("IsStock1SubScribed")) { if (_vm.IsStock1SubScribed) { StockViewerService.AddStockSubscription("Stock1"); } else { StockViewerService.RemoveStockSubscription("Stock1"); } } if (e.PropertyName.Equals("IsStock2SubScribed")) { if (_vm.IsStock2SubScribed) { StockViewerService.AddStockSubscription("Stock2"); } else { StockViewerService.RemoveStockSubscription("Stock2"); } } }
private void Startup( ) { // Dynamically register library //TODO: Autofac depedency here is bad with more time this could be done on the default ServiceContainer var builder = new ContainerBuilder( ); // To load different versions load different Dlls here. LoadLibrary(builder, "StockUtilities.dll"); LoadLibrary(builder, "StockPriceService.dll"); IContainer container = builder.Build( ); StockViewerService = container.Resolve <IStockViewerService>( ); StockObservable = StockViewerService.GetObservable( ); }