public void DeactivatingCountDoesntTickDeactivatedObservable()
        {
            var viewModelActivator = new ViewModelActivator();
            var deactivated        = viewModelActivator.Deactivated.CreateCollection(scheduler: ImmediateScheduler.Instance);

            viewModelActivator.Deactivate(false);

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

            viewModelActivator.Deactivate(true);

            Assert.Equal(1, deactivated.Count);
        }
예제 #3
0
        public void DeactivatingCountDoesntTickDeactivatedObservable()
        {
            var viewModelActivator = new ViewModelActivator();

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

            viewModelActivator.Deactivate(false);

            Assert.Equal(0, deactivated.Count);
        }
예제 #4
0
        public void DeactivatingIgnoringRefCountTicksDeactivatedObservable()
        {
            var viewModelActivator = new ViewModelActivator();

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

            viewModelActivator.Deactivate(true);

            Assert.Equal(1, deactivated.Count);
        }
예제 #5
0
        public void DeactivatingFollowingActivatingTicksDeactivatedObservable()
        {
            var viewModelActivator = new ViewModelActivator();
            var deactivated        = viewModelActivator.Deactivated.CreateCollection();

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

            Assert.Equal(1, deactivated.Count);
        }
예제 #6
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);
        }
 protected sealed override void OnDeactivate(bool close)
 {
     base.OnDeactivate(close);
     mActivator.Deactivate(ignoreRefCount: true);
 }