点击或拖拽改变大小

BindingsAdd 方法 (String, String, Byte, BindingMode, FuncObject, Object, FuncObject, Object, ActionBinding, Object, Exception, ActionBinding, Object, Exception)

添加绑定到UIElement对象上,定义绑定在对应的Element层次上

命名空间:  CPF
程序集:  CPF (在 CPF.dll 中) 版本:0.8.8.5
语法
C#
public Binding Add(
	string propertyName,
	string sourcePropertyName,
	byte sourceElementLayer,
	BindingMode bindingMode = BindingMode.OneWay,
	Func<Object, Object> convert = null,
	Func<Object, Object> convertBack = null,
	Action<Binding, Object, Exception> SourceToTargetError = null,
	Action<Binding, Object, Exception> TargetToSourceError = null
)

参数

propertyName
类型:SystemString

[缺少 "M:CPF.Bindings.Add(System.String,System.String,System.Byte,CPF.BindingMode,System.Func{System.Object,System.Object},System.Func{System.Object,System.Object},System.Action{CPF.Binding,System.Object,System.Exception},System.Action{CPF.Binding,System.Object,System.Exception})" 的 <param name="propertyName"/> 文档]

sourcePropertyName
类型:SystemString

[缺少 "M:CPF.Bindings.Add(System.String,System.String,System.Byte,CPF.BindingMode,System.Func{System.Object,System.Object},System.Func{System.Object,System.Object},System.Action{CPF.Binding,System.Object,System.Exception},System.Action{CPF.Binding,System.Object,System.Exception})" 的 <param name="sourcePropertyName"/> 文档]

sourceElementLayer
类型:SystemByte
UI元素层,0是自己,1是Parent,2是Parent.Parent....
bindingMode (Optional)
类型:CPFBindingMode

[缺少 "M:CPF.Bindings.Add(System.String,System.String,System.Byte,CPF.BindingMode,System.Func{System.Object,System.Object},System.Func{System.Object,System.Object},System.Action{CPF.Binding,System.Object,System.Exception},System.Action{CPF.Binding,System.Object,System.Exception})" 的 <param name="bindingMode"/> 文档]

convert (Optional)
类型:SystemFuncObject, Object

[缺少 "M:CPF.Bindings.Add(System.String,System.String,System.Byte,CPF.BindingMode,System.Func{System.Object,System.Object},System.Func{System.Object,System.Object},System.Action{CPF.Binding,System.Object,System.Exception},System.Action{CPF.Binding,System.Object,System.Exception})" 的 <param name="convert"/> 文档]

convertBack (Optional)
类型:SystemFuncObject, Object

[缺少 "M:CPF.Bindings.Add(System.String,System.String,System.Byte,CPF.BindingMode,System.Func{System.Object,System.Object},System.Func{System.Object,System.Object},System.Action{CPF.Binding,System.Object,System.Exception},System.Action{CPF.Binding,System.Object,System.Exception})" 的 <param name="convertBack"/> 文档]

SourceToTargetError (Optional)
类型:SystemActionBinding, Object, Exception

[缺少 "M:CPF.Bindings.Add(System.String,System.String,System.Byte,CPF.BindingMode,System.Func{System.Object,System.Object},System.Func{System.Object,System.Object},System.Action{CPF.Binding,System.Object,System.Exception},System.Action{CPF.Binding,System.Object,System.Exception})" 的 <param name="SourceToTargetError"/> 文档]

TargetToSourceError (Optional)
类型:SystemActionBinding, Object, Exception

[缺少 "M:CPF.Bindings.Add(System.String,System.String,System.Byte,CPF.BindingMode,System.Func{System.Object,System.Object},System.Func{System.Object,System.Object},System.Action{CPF.Binding,System.Object,System.Exception},System.Action{CPF.Binding,System.Object,System.Exception})" 的 <param name="TargetToSourceError"/> 文档]

返回值

类型:Binding

[缺少 "M:CPF.Bindings.Add(System.String,System.String,System.Byte,CPF.BindingMode,System.Func{System.Object,System.Object},System.Func{System.Object,System.Object},System.Action{CPF.Binding,System.Object,System.Exception},System.Action{CPF.Binding,System.Object,System.Exception})" 的 <returns> 文档]

参见