|
|
|
@ -60,6 +60,8 @@ namespace Avalonia |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc cref="GetObservable{T}(AvaloniaObject, AvaloniaProperty{T})"/>
|
|
|
|
/// <typeparam name="TSource">The type of the values held by the <paramref name="property"/>.</typeparam>
|
|
|
|
/// <typeparam name="TResult">The type of the value returned by the <paramref name="converter"/>.</typeparam>
|
|
|
|
/// <param name="o"/>
|
|
|
|
/// <param name="property"/>
|
|
|
|
/// <param name="converter">A method which is executed to convert each property value to <typeparamref name="TResult"/>.</param>
|
|
|
|
@ -71,6 +73,15 @@ namespace Avalonia |
|
|
|
converter ?? throw new ArgumentNullException(nameof(converter))); |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc cref="GetObservable{TSource,TResult}"/>
|
|
|
|
public static IObservable<TResult> GetObservable<TResult>(this AvaloniaObject o, AvaloniaProperty property, Func<object?, TResult> converter) |
|
|
|
{ |
|
|
|
return new AvaloniaPropertyObservable<object?, TResult>( |
|
|
|
o ?? throw new ArgumentNullException(nameof(o)), |
|
|
|
property ?? throw new ArgumentNullException(nameof(property)), |
|
|
|
converter ?? throw new ArgumentNullException(nameof(converter))); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets an observable for an <see cref="AvaloniaProperty"/>.
|
|
|
|
/// </summary>
|
|
|
|
@ -92,6 +103,15 @@ namespace Avalonia |
|
|
|
property ?? throw new ArgumentNullException(nameof(property))); |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc cref="GetObservable{TSource,TResult}"/>
|
|
|
|
public static IObservable<BindingValue<TResult>> GetBindingObservable<TResult>(this AvaloniaObject o, AvaloniaProperty property, Func<object?, TResult> converter) |
|
|
|
{ |
|
|
|
return new AvaloniaPropertyBindingObservable<object?, TResult>( |
|
|
|
o ?? throw new ArgumentNullException(nameof(o)), |
|
|
|
property ?? throw new ArgumentNullException(nameof(property)), |
|
|
|
converter?? throw new ArgumentNullException(nameof(converter))); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets an observable for an <see cref="AvaloniaProperty"/>.
|
|
|
|
/// </summary>
|
|
|
|
|