<PackageReference Include="System.Reactive" Version="4.1.1" />

ContextDisposable

public sealed class ContextDisposable : ICancelable, IDisposable
Represents a disposable resource whose disposal invocation will be posted to the specified SynchronizationContext.

Gets the provided SynchronizationContext.

public bool IsDisposed { get; }

Gets a value that indicates whether the object is disposed.

Initializes a new instance of the ContextDisposable class that uses the specified SynchronizationContext on which to dispose the specified disposable resource.

public void Dispose()

Disposes the underlying disposable on the provided SynchronizationContext.