<PackageReference Include="System.Reactive" Version="5.0.0-preview.16" />

BehaviorSubject<T>

public sealed class BehaviorSubject<T> : SubjectBase<T>
Represents a value that changes over time. Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications.
public T Value { get; }

Gets the current value or throws an exception.

public BehaviorSubject(T value)

Initializes a new instance of the BehaviorSubject<T> class which creates a subject that caches its last value and starts with the specified value.

public bool TryGetValue(out T value)

Tries to get the current value or throws an exception.