开发者

Databind value array to list datatemplate

开发者 https://www.devze.com 2023-03-10 08:28 出处:网络
I have a datatemplate for listbox: <DataTemplate> <Rectangle Width=\"10\" Height=\"{Binding ???}\" Fill=\"Black\" HorizontalAlignment=\"Center\"/>

I have a datatemplate for listbox:

<DataTemplate>
    <Rectangle Width="10" Height="{Binding ???}" Fill="Black" HorizontalAlignment="Center"/>
</DataTemplate>

The ItemSource of the开发者_如何学Python list is set to int[] array. What should I specify in Binding ??? to make the binding path take the concrete value?

Thanks.


Have you tried just {Binding}?

This will take the item itself.

0

精彩评论

暂无评论...
验证码 换一张
取 消