我想根據項目的高度,以列表視圖的高度綁定,並設置了maxHeight屬性爲:此綁定是否對ListView有效?
MaxHeight="{Binding (ListView.View).ItemHeight*2, RelativeSource={RelativeSource Self}}"
這是做正確的方式?我無法獲得結果。
我想根據項目的高度,以列表視圖的高度綁定,並設置了maxHeight屬性爲:此綁定是否對ListView有效?
MaxHeight="{Binding (ListView.View).ItemHeight*2, RelativeSource={RelativeSource Self}}"
這是做正確的方式?我無法獲得結果。
似乎沒有工作。將PresentationTraceSources.TraceLevel = High添加到您的綁定中,以查看綁定的有效結果。
設置它像這樣:
{Binding Path=Foo, PresentationTraceSources.TraceLevel=High}
System.Windows.Data Warning: 87 : BindingExpression (hash=6270677): TransferValue - using fallback/default value 'Infinity'
System.Windows.Data Warning: 88 : BindingExpression (hash=6270677): TransferValue - using final value 'Infinity'
如果你需要計算的值,使用Converter
,並在計算基數值傳遞爲ConverterParameter
。
你能解釋在哪裏設置PresentationTraceSources.TraceLevel = High? – Joel 2013-05-08 10:59:20
編輯我的答案 – 2013-05-08 11:04:56
不,它不會工作。使用轉換器。 – vorrtex 2013-05-08 11:08:33
相關:http://stackoverflow.com/questions/4969600/how-do-you-change-a-bound-value-reverse-it-multiply-it-subtract-from-it-or-ad – 2013-05-09 13:46:48
@ H.B。謝謝,這很有用:) – Dharmateja 2013-05-10 07:24:07