码迷,mamicode.com
首页 > Windows程序 > 详细

WPF data binding

时间:2016-11-16 19:34:38      阅读:232      评论:0      收藏:0      [点我收藏+]

标签:path   orm   efault   链接   mod   sof   and   form   set   

Binding这个类包含以下几个常用的属性:

ElementName: Gets or sets the name of the elements to use as the binding source object. [Default is null]

Source: Gets or sets the object to use as the binding source. 

RelativeSource: Gets or sets the binding source by specifying its location relative to the position of the binding target.

Converter: Gets or sets the converter to use.

Mode: Gets or sets a value that indicates the direction of the data flow in the binding.

Path: Gets or sets the path to the binding source property.

StringFormat: Gets or sets a string that specifies how to format the binding if it displays the bound value as a string.(Inherited from BindingBase.)

  • Only one of the three properties, ElementName, Source, and RelativeSource, should be set for each binding, or a conflict might occur. 
  • By default, bindings inherit the data context specified by the DataContext property
  • Path is the default property of a binding. {Binding PropertyName} 等价于 {Binding Path=PropertyName}
  • {Binding} is equivalent to {Binding Path=.}, which binds to the current source

 

参考链接:

https://msdn.microsoft.com/en-us/library/system.windows.data.binding(v=vs.110).aspx

https://msdn.microsoft.com/en-us/library/ms750413.aspx

http://stackoverflow.com/questions/1906587/wpf-bind-to-itself

https://msdn.microsoft.com/en-us/library/ms746695(v=vs.110).aspx

https://msdn.microsoft.com/en-us/library/ms752347(v=vs.110).aspx

WPF data binding

标签:path   orm   efault   链接   mod   sof   and   form   set   

原文地址:http://www.cnblogs.com/liangzi4000/p/6070656.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!