示例#1
0
        private IDisposable BindInformer()
        {
            Model.InformerModel = InformerModel.Hidden();

            return(SubscribeToTarget(target =>
            {
                _informerActivator.Deactivate(ref _informerController);
                var model = _informerActivator.Activate(target, ref _informerController);
                Model.InformerModel = model;
            }));
        }
示例#2
0
        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;
                }
            }));
        }