Home >Database >Mysql Tutorial >WPF 中Binding的2个属性Source与ElementName的区别

WPF 中Binding的2个属性Source与ElementName的区别

WBOY
WBOYOriginal
2016-06-07 15:44:001833browse

http://www.im47.cn/?p=482 ElementName The ElementName property is used to reference an object by the name of the object. This is particularly useful in XAML, where you can directly reference other elements defined in XAML. 举例 StackPanel

http://www.im47.cn/?p=482

ElementName
The ElementName property is used to reference an object by the name of the object. This is particularly useful in XAML, where you can directly reference other elements defined in XAML.

举例


Source
The Source property is used to specify an object reference on which the binding Path or XPath will be evaluated. The Source property is usually used when the object on which the Binding is set is known and differs from the DataContext.

举例:

 

简单地说,“ElementName”用于绑定到xaml界面设计中添加的其它控件对象,“Source”用于绑到资源中的对象。

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:BLAST2GONext article:db2 catalog 远程数据库到本地