| BindableBindingT, TValueBindDataContextTObject Method (FuncTObject, TValue, ActionTObject, TValue, ActionTObject, EventHandlerEventArgs, ActionTObject, EventHandlerEventArgs, DualBindingMode, TValue, TValue) | 
 
            Binds to a control's 
DataContext using delegates to get/set the value.
            
 
    Namespace: 
   Eto.Forms
    Assembly:
   Eto (in Eto.dll) Version: 2.5.3-dev
 Syntax
Syntaxpublic DualBinding<TValue> BindDataContext<TObject>(
	Func<TObject, TValue> getValue,
	Action<TObject, TValue> setValue,
	Action<TObject, EventHandler<EventArgs>> addChangeEvent = null,
	Action<TObject, EventHandler<EventArgs>> removeChangeEvent = null,
	DualBindingMode mode = DualBindingMode.TwoWay,
	TValue defaultGetValue = null,
	TValue defaultSetValue = null
)
Public Function BindDataContext(Of TObject) ( 
	getValue As Func(Of TObject, TValue),
	setValue As Action(Of TObject, TValue),
	Optional addChangeEvent As Action(Of TObject, EventHandler(Of EventArgs)) = Nothing,
	Optional removeChangeEvent As Action(Of TObject, EventHandler(Of EventArgs)) = Nothing,
	Optional mode As DualBindingMode = DualBindingMode.TwoWay,
	Optional defaultGetValue As TValue = Nothing,
	Optional defaultSetValue As TValue = Nothing
) As DualBinding(Of TValue)
member BindDataContext : 
        getValue : Func<'TObject, 'TValue> * 
        setValue : Action<'TObject, 'TValue> * 
        ?addChangeEvent : Action<'TObject, EventHandler<EventArgs>> * 
        ?removeChangeEvent : Action<'TObject, EventHandler<EventArgs>> * 
        ?mode : DualBindingMode * 
        ?defaultGetValue : 'TValue * 
        ?defaultSetValue : 'TValue 
(* Defaults:
        let _addChangeEvent = defaultArg addChangeEvent null
        let _removeChangeEvent = defaultArg removeChangeEvent null
        let _mode = defaultArg mode DualBindingMode.TwoWay
        let _defaultGetValue = defaultArg defaultGetValue null
        let _defaultSetValue = defaultArg defaultSetValue null
*)
-> DualBinding<'TValue> 
Parameters
- getValue
- Type: SystemFuncTObject, TValue
 Delegate to get the value from the data context.
- setValue
- Type: SystemActionTObject, TValue
 Delegate to set the value to the data context when changed.
- addChangeEvent (Optional)
- Type: SystemActionTObject, EventHandlerEventArgs
 Delegate to add a change event on the data context.
- removeChangeEvent (Optional)
- Type: SystemActionTObject, EventHandlerEventArgs
 Delegate to remove the change event from the data context.
- mode (Optional)
- Type: Eto.FormsDualBindingMode
 Dual binding mode.
- defaultGetValue (Optional)
- Type: TValue
 Default get value.
- defaultSetValue (Optional)
- Type: TValue
 Default set value.
Type Parameters
- TObject
- Type of the data context object to bind with.
Return Value
Type: 
DualBindingTValueA new dual binding that binds the control to this object binding.
 Remarks
Remarks
            This is a shortcut to use the 
DelegateBindingT, TValue to bind to a control's 
DataContext property.
            When the data context type is 
TValue, then the delegates will be called to get/set the value.
            Otherwise, if the data context is null or a different type, the 
defaultGetValue will be used.
            
 See Also
See Also