BindableExtensionsBindDataContextTWidget, TValue Method (TWidget, ExpressionFuncTWidget, TValue, IndirectBindingTValue, DualBindingMode, TValue, TValue) |
Namespace:
Eto.Forms
Assembly:
Eto (in Eto.dll) Version: 2.5.3-dev
Syntax public static DualBinding<TValue> BindDataContext<TWidget, TValue>(
this TWidget control,
Expression<Func<TWidget, TValue>> controlProperty,
IndirectBinding<TValue> sourceBinding,
DualBindingMode mode = DualBindingMode.TwoWay,
TValue defaultControlValue = null,
TValue defaultContextValue = null
)
where TWidget : IBindable
<ExtensionAttribute>
Public Shared Function BindDataContext(Of TWidget As IBindable, TValue) (
control As TWidget,
controlProperty As Expression(Of Func(Of TWidget, TValue)),
sourceBinding As IndirectBinding(Of TValue),
Optional mode As DualBindingMode = DualBindingMode.TwoWay,
Optional defaultControlValue As TValue = Nothing,
Optional defaultContextValue As TValue = Nothing
) As DualBinding(Of TValue)
[<ExtensionAttribute>]
static member BindDataContext :
control : 'TWidget *
controlProperty : Expression<Func<'TWidget, 'TValue>> *
sourceBinding : IndirectBinding<'TValue> *
?mode : DualBindingMode *
?defaultControlValue : 'TValue *
?defaultContextValue : 'TValue
(* Defaults:
let _mode = defaultArg mode DualBindingMode.TwoWay
let _defaultControlValue = defaultArg defaultControlValue null
let _defaultContextValue = defaultArg defaultContextValue null
*)
-> DualBinding<'TValue> when 'TWidget : IBindable
Parameters
- control
- Type: TWidget
Control to bind to. - controlProperty
- Type: System.Linq.ExpressionsExpressionFuncTWidget, TValue
Control property. - sourceBinding
- Type: Eto.FormsIndirectBindingTValue
Source binding to get/set the value on the data context. - mode (Optional)
- Type: Eto.FormsDualBindingMode
Mode of the binding. - defaultControlValue (Optional)
- Type: TValue
Default control value, if the control value is null. - defaultContextValue (Optional)
- Type: TValue
Default context value, if the context value is null.
Type Parameters
- TWidget
- The type of control.
- TValue
- The type of the property.
Return Value
Type:
DualBindingTValue[Missing <returns> documentation for "M:Eto.Forms.BindableExtensions.BindDataContext``2(``0,System.Linq.Expressions.Expression{System.Func{``0,``1}},Eto.Forms.IndirectBinding{``1},Eto.Forms.DualBindingMode,``1,``1)"]
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type . 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