1.静态资源绑定Element/Source
2.DataContext数据绑定
3. 集合绑定
RelativeSource
Mode
public enum RelativeSourceMode
{
PreviousData = 0,//前一个值
TemplatedParent = 1,//相当于Binding Value,RelativeSource={RelativeSource XXX}
Self = 2,//自身的属性
FindAncestor = 3//查找祖先类
}
4.依赖附加属性进行子项数据集合绑定
5.数据绑定属性-Mode/UpdateSourceTrigger
//
// 摘要:
// Describes the direction of the data flow in a binding.
public enum BindingMode
{
TwoWay = 0,//双向绑定
OneWay = 1,//从源到目标 DM1.Value--->TextBox
OneTime = 2,//一次,只接收源的初始值
OneWayToSource = 3,//只允许从目标到源
Default = 4
}
public enum UpdateSourceTrigger
{
Default = 0,//
PropertyChanged = 1,//值改变立马更新
LostFocus = 2,//失去焦点才更新,默认
Explicit = 3//明确的触发方式
}
注意:
6.多重绑定
7.优先级绑定