<PackageReference Include="ReactiveUI.Disposables" Version="7.4.0" />

ReactiveUI.Primitives.Disposables.OnceDisposable

public sealed class OnceDisposable : IsDisposed, IDisposable
A disposable holder whose inner disposable can be set exactly once. Replaces SingleAssignmentDisposable. Subsequent assignments throw InvalidOperationException; if the holder has been disposed before assignment, the supplied disposable is disposed immediately and no exception is thrown.
public IDisposable Disposable { get; set; }

Gets or sets the inner disposable. Setting more than once throws.

public bool IsAssigned { get; }

Gets a value indicating whether a disposable has been assigned.

public bool IsDisposed { get; }

Gets a value indicating whether this instance has been disposed.

public OnceDisposable()

public void Dispose()