Click or drag to resize

BindableExtensions.DefaultIfNull<T, TValue> Method (BindableBinding<T, TValue>, TValue)

Gets a binding that returns a defaultValue if the specified binding returns a null value.

Namespace:  Eto.Forms
Assembly:  Eto (in Eto.dll) Version: 2.5.3-dev
Syntax
public static BindableBinding<T, TValue> DefaultIfNull<T, TValue>(
	this BindableBinding<T, TValue> binding,
	TValue defaultValue
)
where T : IBindable
where TValue : class

Parameters

binding
Type: Eto.Forms.BindableBinding<T, TValue>
Source of the binding to get the value.
defaultValue
Type: TValue
Default value to return instead of null.

Type Parameters

T
The type of the bindable object.
TValue
The value type.

Return Value

Type: BindableBinding<T, TValue>
A new binding that returns a non-null value.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type BindableBinding<T, TValue>. 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).
See Also