BindableExtensionsDefaultIfNullT, TValue Method (BindableBindingT, 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
<ExtensionAttribute>
Public Shared Function DefaultIfNull(Of T As IBindable, TValue As Class) (
binding As BindableBinding(Of T, TValue),
defaultValue As TValue
) As BindableBinding(Of T, TValue)
[<ExtensionAttribute>]
static member DefaultIfNull :
binding : BindableBinding<'T, 'TValue> *
defaultValue : 'TValue -> BindableBinding<'T, 'TValue> when 'T : IBindable when 'TValue : not struct
Parameters
- binding
- Type: Eto.FormsBindableBindingT, 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:
BindableBindingT,
TValueA 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
BindableBindingT,
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