Example #1
0
        public virtual void Dispose()
        {
            InformerModel?.Dispose();
            CatalogModel?.Dispose();
            ExplorerModel?.Dispose();
            EditorModel?.Dispose();

            _modelDisposable.Dispose();
        }
Example #2
0
        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();
            }));
        }