BindableExtensionsBindDataContextT Method (IBindable, IndirectBindingT, IndirectBindingT, DualBindingMode, T, T) |
Adds a new binding from the control to its data context
Namespace:
Eto.Forms
Assembly:
Eto (in Eto.dll) Version: 2.5.3-dev
Syntax public static DualBinding<T> BindDataContext<T>(
this IBindable bindable,
IndirectBinding<T> controlBinding,
IndirectBinding<T> dataContextBinding,
DualBindingMode mode = DualBindingMode.TwoWay,
T defaultControlValue = null,
T defaultContextValue = null
)
<ExtensionAttribute>
Public Shared Function BindDataContext(Of T) (
bindable As IBindable,
controlBinding As IndirectBinding(Of T),
dataContextBinding As IndirectBinding(Of T),
Optional mode As DualBindingMode = DualBindingMode.TwoWay,
Optional defaultControlValue As T = Nothing,
Optional defaultContextValue As T = Nothing
) As DualBinding(Of T)
[<ExtensionAttribute>]
static member BindDataContext :
bindable : IBindable *
controlBinding : IndirectBinding<'T> *
dataContextBinding : IndirectBinding<'T> *
?mode : DualBindingMode *
?defaultControlValue : 'T *
?defaultContextValue : 'T
(* Defaults:
let _mode = defaultArg mode DualBindingMode.TwoWay
let _defaultControlValue = defaultArg defaultControlValue null
let _defaultContextValue = defaultArg defaultContextValue null
*)
-> DualBinding<'T>
Parameters
- bindable
- Type: Eto.FormsIBindable
Bindable object to add the binding to - controlBinding
- Type: Eto.FormsIndirectBindingT
Binding to get/set the value from the control. - dataContextBinding
- Type: Eto.FormsIndirectBindingT
Binding to get/set the value from the DataContext. - mode (Optional)
- Type: Eto.FormsDualBindingMode
Mode of the binding. - defaultControlValue (Optional)
- Type: T
Default control value to set to the objectValue, if the value of the control property is null. - defaultContextValue (Optional)
- Type: T
Default context value to set to the control, if the objectValue or value of the objectBinding is null.
Type Parameters
- T
[Missing <typeparam name="T"/> documentation for "M:Eto.Forms.BindableExtensions.BindDataContext``1(Eto.Forms.IBindable,Eto.Forms.IndirectBinding{``0},Eto.Forms.IndirectBinding{``0},Eto.Forms.DualBindingMode,``0,``0)"]
Return Value
Type:
DualBindingT[Missing <returns> documentation for "M:Eto.Forms.BindableExtensions.BindDataContext``1(Eto.Forms.IBindable,Eto.Forms.IndirectBinding{``0},Eto.Forms.IndirectBinding{``0},Eto.Forms.DualBindingMode,``0,``0)"]
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IBindable. 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