BindableExtensionsBindDataContextTWidget, TContext, TValue Method (TWidget, ExpressionFuncTWidget, TValue, ExpressionFuncTContext, TValue, DualBindingMode, TValue, TValue) |
Namespace:
Eto.Forms
Assembly:
Eto (in Eto.dll) Version: 2.5.3-dev
Syntax public static DualBinding<TValue> BindDataContext<TWidget, TContext, TValue>(
this TWidget control,
Expression<Func<TWidget, TValue>> controlProperty,
Expression<Func<TContext, TValue>> sourceProperty,
DualBindingMode mode = DualBindingMode.TwoWay,
TValue defaultControlValue = null,
TValue defaultContextValue = null
)
where TWidget : IBindable
<ExtensionAttribute>
Public Shared Function BindDataContext(Of TWidget As IBindable, TContext, TValue) (
control As TWidget,
controlProperty As Expression(Of Func(Of TWidget, TValue)),
sourceProperty As Expression(Of Func(Of TContext, 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>> *
sourceProperty : Expression<Func<'TContext, '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. - sourceProperty
- Type: System.Linq.ExpressionsExpressionFuncTContext, TValue
Source property from 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.
- TContext
- The type of the data context object.
- TValue
- The type of the property.
Return Value
Type:
DualBindingTValue[Missing <returns> documentation for "M:Eto.Forms.BindableExtensions.BindDataContext``3(``0,System.Linq.Expressions.Expression{System.Func{``0,``2}},System.Linq.Expressions.Expression{System.Func{``1,``2}},Eto.Forms.DualBindingMode,``2,``2)"]
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