public void ActivatingTicksActivatedObservable()
        {
            var viewModelActivator = new ViewModelActivator();
            var activated          = viewModelActivator.Activated.CreateCollection(scheduler: ImmediateScheduler.Instance);

            viewModelActivator.Activate();

            Assert.Equal(1, activated.Count);
        }
Ejemplo n.º 2
0
        public void ActivatingTicksActivatedObservable()
        {
            var viewModelActivator = new ViewModelActivator();
            var activated          = viewModelActivator.Activated.CreateCollection();

            viewModelActivator.Activate();

            Assert.Equal(1, activated.Count);
        }
Ejemplo n.º 3
0
        public void ActivatingTicksActivatedObservable()
        {
            var viewModelActivator = new ViewModelActivator();

            viewModelActivator.Activated.ToObservableChangeSet(ImmediateScheduler.Instance).Bind(out var activated).Subscribe();

            viewModelActivator.Activate();

            Assert.Equal(1, activated.Count);
        }
        public void DeactivatingFollowingActivatingTicksDeactivatedObservable()
        {
            var viewModelActivator = new ViewModelActivator();
            var deactivated        = viewModelActivator.Deactivated.CreateCollection(scheduler: ImmediateScheduler.Instance);

            viewModelActivator.Activate();
            viewModelActivator.Deactivate(false);

            Assert.Equal(1, deactivated.Count);
        }
Ejemplo n.º 5
0
        public void TestDeactivatingFollowingActivatingTicksDeactivatedObservable()
        {
            var viewModelActivator = new ViewModelActivator();

            viewModelActivator.Deactivated.ToObservableChangeSet(ImmediateScheduler.Instance).Bind(out var deactivated).Subscribe();

            viewModelActivator.Activate();
            viewModelActivator.Deactivate(false);

            Assert.Equal(1, deactivated.Count);
        }
        public void DisposingAfterActivationDeactivatesViewModel()
        {
            var viewModelActivator = new ViewModelActivator();
            var activated          = viewModelActivator.Activated.CreateCollection();
            var deactivated        = viewModelActivator.Deactivated.CreateCollection();

            using (viewModelActivator.Activate()) {
                Assert.Equal(1, activated.Count);
                Assert.Equal(0, deactivated.Count);
            }

            Assert.Equal(1, activated.Count);
            Assert.Equal(1, deactivated.Count);
        }
Ejemplo n.º 7
0
        public void DisposingAfterActivationDeactivatesViewModel()
        {
            var viewModelActivator = new ViewModelActivator();

            viewModelActivator.Activated.ToObservableChangeSet(ImmediateScheduler.Instance).Bind(out var activated).Subscribe();
            viewModelActivator.Deactivated.ToObservableChangeSet(ImmediateScheduler.Instance).Bind(out var deactivated).Subscribe();

            using (viewModelActivator.Activate()) {
                Assert.Equal(1, activated.Count);
                Assert.Equal(0, deactivated.Count);
            }

            Assert.Equal(1, activated.Count);
            Assert.Equal(1, deactivated.Count);
        }
 protected sealed override void OnActivate()
 {
     base.OnActivate();
     mActivator.Activate();
 }