开发者

Binding to the whole data item in XAML

开发者 https://www.devze.com 2023-02-04 04:22 出处:网络
I\'m using XAML data binding for a ListBox whose ItemSource is set to a list of TypeA object.One UI element in the ItemTemplate for the ListBox is bound to a property of TypeA as follows:

I'm using XAML data binding for a ListBox whose ItemSource is set to a list of TypeA object. One UI element in the ItemTemplate for the ListBox is bound to a property of TypeA as follows:

Source="{Binding PropertyName, Converter={Static开发者_JAVA百科Resource customConverter}}"

Now, instead of binding to a specific property, I want the UI element to be bound to the whole TypeA instance so that the custom converter can compute value from multiple properties. The question is: which binding expression I can use to achieve that?


Youn include no path at all to do that:-

 Source="{Binding Converter={StaticResource customConverter}}


Have you tried this:

Source="{Binding ., Converter={StaticResource customConverter}}"
0

精彩评论

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