6

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={StaticResource 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?

Buu
  • 49,745
  • 5
  • 67
  • 85

2 Answers2

6

Have you tried this:

Source="{Binding ., Converter={StaticResource customConverter}}"
TerenceJackson
  • 1,776
  • 15
  • 24
  • Both your & Anthony's approach work. +1 for both. Since Anthony was first, I accepted his answer. Thank you. – Buu Jan 13 '11 at 10:13
6

Youn include no path at all to do that:-

 Source="{Binding Converter={StaticResource customConverter}}
AnthonyWJones
  • 187,081
  • 35
  • 232
  • 306