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); }
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); }
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); }
public void DeactivatingFollowingActivatingTicksDeactivatedObservable() { var viewModelActivator = new ViewModelActivator(); var deactivated = viewModelActivator.Deactivated.CreateCollection(); viewModelActivator.Activate(); viewModelActivator.Deactivate(false); Assert.Equal(1, deactivated.Count); }
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); }