public virtual void Dispose() { InformerModel?.Dispose(); CatalogModel?.Dispose(); ExplorerModel?.Dispose(); EditorModel?.Dispose(); _modelDisposable.Dispose(); }
private IDisposable BindInformer(IFactory <Target, InformerModel> informerModelFactory) { var chatSubscription = SubscribeToSelectedChat(chat => { InformerModel?.Dispose(); InformerModel = informerModelFactory.Create(chat); }); var aggregateSubscription = SubscribeToSelectedAggregate(aggregate => { InformerModel?.Dispose(); InformerModel = informerModelFactory.Create(aggregate); }); return(Disposable.Create(() => { chatSubscription.Dispose(); aggregateSubscription.Dispose(); })); }