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
Syntax 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()
<ExtensionAttribute>
Public Shared Function DefaultIfNull(Of T As IBindable, TValue As {Structure, New}) (
binding As BindableBinding(Of T, Nullable(Of TValue)),
Optional defaultValue As Nullable(Of TValue) = Nothing
) As BindableBinding(Of T, TValue)
[<ExtensionAttribute>]
static member DefaultIfNull :
binding : BindableBinding<'T, Nullable<'TValue>> *
?defaultValue : Nullable<'TValue>
(* Defaults:
let _defaultValue = defaultArg defaultValue null
*)
-> BindableBinding<'T, 'TValue> when 'T : IBindable when 'TValue : struct, new()
Parameters
- binding
- 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
- T
- The type of the bindable object.
- TValue
- The value type to convert from nullable to non-nullable.
Return Value
Type:
BindableBindingT,
TValueA 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