首页 > 代码库 > wpf Binding 小记录

wpf Binding 小记录

 

属性绑定:

Grid g = new Grid() { Width = 60, Height = 100 };
g.SetValue(Panel.ZIndexProperty, 10);
//Canvas.SetBottom 绑定数据MLength
Binding bind = new Binding("MoLength") { Source = this };
g.SetBinding(Canvas.BottomProperty,bind);

注:MLength为依赖性属性

 

wpf Binding 小记录