BindingDelegateT, TValue Method (FuncT, TValue, ActionT, TValue, ActionT, EventHandlerEventArgs, ActionT, EventHandlerEventArgs, TValue, TValue) |
Creates a new indirect delegate binding.
Namespace:
Eto.Forms
Assembly:
Eto (in Eto.dll) Version: 2.5.3-dev
Syntax public static IndirectBinding<TValue> Delegate<T, TValue>(
Func<T, TValue> getValue,
Action<T, TValue> setValue = null,
Action<T, EventHandler<EventArgs>> addChangeEvent = null,
Action<T, EventHandler<EventArgs>> removeChangeEvent = null,
TValue defaultGetValue = null,
TValue defaultSetValue = null
)
Public Shared Function Delegate(Of T, TValue) (
getValue As Func(Of T, TValue),
Optional setValue As Action(Of T, TValue) = Nothing,
Optional addChangeEvent As Action(Of T, EventHandler(Of EventArgs)) = Nothing,
Optional removeChangeEvent As Action(Of T, EventHandler(Of EventArgs)) = Nothing,
Optional defaultGetValue As TValue = Nothing,
Optional defaultSetValue As TValue = Nothing
) As IndirectBinding(Of TValue)
static member Delegate :
getValue : Func<'T, 'TValue> *
?setValue : Action<'T, 'TValue> *
?addChangeEvent : Action<'T, EventHandler<EventArgs>> *
?removeChangeEvent : Action<'T, EventHandler<EventArgs>> *
?defaultGetValue : 'TValue *
?defaultSetValue : 'TValue
(* Defaults:
let _setValue = defaultArg setValue null
let _addChangeEvent = defaultArg addChangeEvent null
let _removeChangeEvent = defaultArg removeChangeEvent null
let _defaultGetValue = defaultArg defaultGetValue null
let _defaultSetValue = defaultArg defaultSetValue null
*)
-> IndirectBinding<'TValue>
Parameters
- getValue
- Type: SystemFuncT, TValue
Delegate to get the value for the binding. - setValue (Optional)
- Type: SystemActionT, TValue
Delegate to set the value for the binding. - addChangeEvent (Optional)
- Type: SystemActionT, EventHandlerEventArgs
Delegate to register the change event, when needed by the consumer of this binding. - removeChangeEvent (Optional)
- Type: SystemActionT, EventHandlerEventArgs
Delegate to remove the change event. - defaultGetValue (Optional)
- Type: TValue
Default get value, when the object instance is null. - defaultSetValue (Optional)
- Type: TValue
Default set value, when the incoming value is null.
Type Parameters
- T
[Missing <typeparam name="T"/> documentation for "M:Eto.Forms.Binding.Delegate``2(System.Func{``0,``1},System.Action{``0,``1},System.Action{``0,System.EventHandler{System.EventArgs}},System.Action{``0,System.EventHandler{System.EventArgs}},``1,``1)"]
- TValue
[Missing <typeparam name="TValue"/> documentation for "M:Eto.Forms.Binding.Delegate``2(System.Func{``0,``1},System.Action{``0,``1},System.Action{``0,System.EventHandler{System.EventArgs}},System.Action{``0,System.EventHandler{System.EventArgs}},``1,``1)"]
Return Value
Type:
IndirectBindingTValue[Missing <returns> documentation for "M:Eto.Forms.Binding.Delegate``2(System.Func{``0,``1},System.Action{``0,``1},System.Action{``0,System.EventHandler{System.EventArgs}},System.Action{``0,System.EventHandler{System.EventArgs}},``1,``1)"]
See Also