<PackageReference Include="ReactiveUI.Primitives.Core" Version="8.2.0" />

ReactiveUI.Primitives.Signals.BehaviorSignal<T>

public sealed class BehaviorSignal<T> : ISignal<T>, ISignal<T, T>, IObserver<T>, IObservable<T>, IsDisposed, IDisposable, IWitnessRemovable<T>
A signal that replays its most recent value to new subscribers.
public bool HasObservers { get; }

Gets a value indicating whether this instance has observers.

public bool IsDisposed { get; }

Gets a value indicating whether this instance is disposed.

public T Value { get; }

Gets the most recent value, which is the constructor's default until OnNext supplies one.

public BehaviorSignal(T defaultValue)

Initializes a new instance of the BehaviorSignal<T> class.

public void Dispose()

Drops the observers and the cached value, making later reads throw.

public void OnCompleted()

Notifies all subscribed observers about the end of the sequence.

public void OnError(Exception error)

Notifies all subscribed observers about the exception.

public void OnNext(T value)

Notifies all subscribed observers about the arrival of the specified element in the sequence.

public IDisposable Subscribe(IObserver<T> observer)

Subscribes an observer, replaying the current value or the terminal notification.

public bool TryGetValue(out T value)

Tries to read the most recent value.