1 4大要素:
绑定源:标示源属性所存在的类型实例
路径: 需要绑定到的处于绑定源之上的源属性
绑定目标:接受相应更改的属性所在的实例
目标属性:接受绑定运行值的目标
2 触发过程:
绑定源发出属性更新的通知,从而驱动绑定执行。其中源属性将作为绑定的输入,而绑定的输出则被赋予目标属性。
3 静态:
A方式: <Button Content="{Binding Source=BindingSource, Path=BindingPath}"/>
B方式:
<Button>
<Binding Source="BindingSource" Path="BindingPath"/>
</Button>
Binding binding = new Binding("BindingPath");
binding.Source = BindingSource;
mButton.SetBinding(Button.ContentProperty, binding);
button 绑定目标, bingPath:路径 contenProperty: 目标属性 bingding.source:绑定源