首頁 > 資料庫 > mysql教程 > WPF 中Binding的2个属性Source与ElementName的区别

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

WBOY
發布: 2016-06-07 15:44:00
原創
1831 人瀏覽過

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”用于绑到资源中的对象。

 

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板