[英]What does a single 'binding' mean in a XAML label?
這里的acceptecd答案說明了如何為TabItem
實現雙擊事件。
我了解該方法的唯一含義是: <Label Content={Binding}>
{Binding}
在這里對標簽內容究竟意味着什么?
... period(。)路徑可用於綁定到當前源 。 例如,Text =“ {Binding}”等效於Text =“ {Binding Path =。}”
這意味着它將綁定DataContext
中當前可用的整個對象,然后將其轉換為使用默認模板或自定義模板進行顯示
編輯
在這種情況下TabItem
承載ContentPresenter
與ContentSource
設置為Header
,其改變DataContext
到任何當前是在可用Header
因此DataContext
用於Label
將被設置為string
中定義Header
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.