GetObservable<TSource, TResult>(AvaloniaObject, AvaloniaProperty<TSource>, Func<TSource, TResult>) Method
Gets an observable for an AvaloniaProperty.
Definition
Namespace: Avalonia
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public static IObservable<TResult> GetObservable<TSource, TResult>(
this AvaloniaObject o,
AvaloniaProperty<TSource> property,
Func<TSource, TResult> converter
)
<ExtensionAttribute>
Public Shared Function GetObservable(Of TSource, TResult) (
o As AvaloniaObject,
property As AvaloniaProperty(Of TSource),
converter As Func(Of TSource, TResult)
) As IObservable(Of TResult)
[<ExtensionAttribute>]
static member GetObservable :
o : AvaloniaObject *
property : AvaloniaProperty<'TSource> *
converter : Func<'TSource, 'TResult> -> IObservable<'TResult>
Parameters
- AvaloniaObject
- AvaloniaProperty(TSource)
- Func(TSource, TResult)
- A method which is executed to convert each property value to TResult.
Type Parameters
- The type of the values held by the property.
- The type of the value returned by the converter.
Return Value
IObservable(TResult)
An observable which fires immediately with the current value of the property on the object and subsequently each time the property value changes.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type AvaloniaObject. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
The subscription to o is created using a weak reference.
See Also
Reference
AvaloniaObjectExtensions Class
GetObservable Overload
Avalonia Namespace