using System; using System.Reactive.Subjects; using Avalonia.Data; #nullable enable namespace Avalonia.Reactive { public static class BindingValueExtensions { public static IObservable> ToBindingValue(this IObservable source) { source = source ?? throw new ArgumentNullException(nameof(source)); return new BindingValueAdapter(source); } public static ISubject> ToBindingValue(this ISubject source) { source = source ?? throw new ArgumentNullException(nameof(source)); return new BindingValueSubjectAdapter(source); } public static IObservable ToUntyped(this IObservable> source) { source = source ?? throw new ArgumentNullException(nameof(source)); return new UntypedBindingAdapter(source); } public static ISubject ToUntyped(this ISubject> source) { source = source ?? throw new ArgumentNullException(nameof(source)); return new UntypedBindingSubjectAdapter(source); } } }