public async Task <bool> WaitAsync(CancellationToken cancellationToken = default) { var queue = new TaskCompletionQueuedSource <T>(); void SubscribeOnChange(T newValue) => queue.NewData(newValue); try { OnChange.Add(SubscribeOnChange); if (await queue.WaitValueAsync(cancellationToken).ConfigureAwait(false) is var result && result.Ok) { Value = result.Value; } return(result.Ok); } finally { OnChange.Remove(SubscribeOnChange); } }