ReactiveUI.ViewModelActivator.Activate C# (CSharp) Méthode

Activate() public méthode

This method is called by the framework when the corresponding View is activated. Call this method in unit tests to simulate a ViewModel being activated.
public Activate ( ) : IDisposable
Résultat IDisposable
        public IDisposable Activate()
        {
            if (Interlocked.Increment(ref refCount) == 1) {
                var disp = new CompositeDisposable(blocks.SelectMany(x => x()));
                Interlocked.Exchange(ref activationHandle, disp).Dispose();
                activated.OnNext(Unit.Default);
            }

            return Disposable.Create(() => Deactivate());
        }