<PackageReference Include="ReactiveUI.Primitives.Core" Version="7.4.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 current value or throws an exception.

public BehaviorSignal(T defaultValue)

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

public void Dispose()

Releases unmanaged and - optionally - managed resources.

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 to the subject.

public bool TryGetValue(out T value)

Tries to get the current value or throws an exception.