public virtual void Dispose() { InformerModel?.Dispose(); CatalogModel?.Dispose(); ExplorerModel?.Dispose(); EditorModel?.Dispose(); _modelDisposable.Dispose(); }
private IDisposable BindInformer() { Model.InformerModel = InformerModel.Hidden(); return(SubscribeToTarget(target => { _informerActivator.Deactivate(ref _informerController); var model = _informerActivator.Activate(target, ref _informerController); Model.InformerModel = model; })); }
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(); })); }
public static IDisposable BindInformer(this MessengerModel model) { model.InformerModel = InformerModel.Hidden(); return(model.SubscribeToSelection(entry => { switch (entry) { case ChatEntryModel chatEntryModel: model.InformerModel = new InformerModel(chatEntryModel.Chat); break; case AggregateEntryModel aggregateEntryModel: model.InformerModel = new InformerModel(aggregateEntryModel.Aggregate); break; case HomeEntryModel _: model.InformerModel = InformerModel.Hidden(); break; } })); }