0

Despite having read similar questions, I could not find any one that worked well in my case.

Basically, in order to extend the functionality of the TableRow class, I created a new one in which I have registered a DependencyProperty to clear the cells, and according to Msdn, I am trying to bind two index from a collection, as follows:

<my:myExtendedClass myProperty="{Binding Path=MyCollection[index1,index2]}">

However, I get the following error when I try to pass more than one index:

Error in Template: 'Unexpected token 'String' in rule: 'MarkupExtension ::= '{' TYPENAME (Arguments)? @'}'', in '{Binding Path=MyCollection[index1,index2]}'.'

Other approach would be bind the whole object MyCollection, but, in this way, I would not know which items I have to check each time I call the method.

So, how should I proceed? Thanks in advance!

AdaByron
  • 23
  • 3
  • Possible duplicate of http://stackoverflow.com/questions/15865289/binding-to-multiple-indexers – Karmacon Jan 26 '16 at 01:59
  • Hi @Karmacon! I had already read the post you mentioned, but, unfortunately, it did not help me, because the guy is trying to retrieve a value from a multi-dimensional array. However, in my case, I am trying to retrieve several values from a one-dimensional array :) – AdaByron Jan 26 '16 at 08:10
  • You will need to be more specific about what you are trying to accomplish. Are you trying to filter the data in the collection? Or bind to an entire collection? – Karmacon Jan 26 '16 at 17:44
  • It would be helpful to show us what the collection looks like and what the extended class looks like. – Karmacon Jan 26 '16 at 17:49
  • As I have to call this class many times, each time I have to pass only the items that I need, such as `index1` and `index2`. Concretely, I have registered a new DependencyProperty of TableRow to clear the cells if the items passed as arguments are empty :) – AdaByron Jan 27 '16 at 08:07

0 Answers0