Click or drag to resize

BindableExtensionsDefaultIfNullT, TValue Method (BindableBindingT, NullableTValue, NullableTValue)

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
public static BindableBinding<T, TValue> DefaultIfNull<T, TValue>(
	this BindableBinding<T, Nullable<TValue>> binding,
	Nullable<TValue> defaultValue = null
where T : IBindable
where TValue : struct, new()


Type: Eto.FormsBindableBindingT, NullableTValue
Source of the binding to get the value.
defaultValue (Optional)
Type: SystemNullableTValue
Default value, or null to use default(TValue).

Type Parameters

The type of the bindable object.
The value type to convert from nullable to non-nullable.

Return Value

Type: BindableBindingT, TValue
A new binding that returns a non-nullable value.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type BindableBindingT, NullableTValue. 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