Reputation: 1851
I have a ObservableCollection<IDictionary<string, object>>
as ItemSource
for a ListView
. Inside I use a custom ViewCell
that has, let's say, an Entry
inside.
Now of course the BindingContext
for it is an ExpandoObject
and I can bind the value stored for the key Name
to the Entry.Text
in XAML by writing:
<Entry Text="{Binding [Name]}" />
Works fine so far, but what I want to do is to get the key (Name
in this case) from a property inside the custom ViewCell
(This may sound weird but in fact this is a sub-view of the actual custom ViewCell
and the ViewCell
itself actually represents a row in a table).
So what I tried to do is:
<Entry Text="{Binding [{Binding Key, Source={x:Reference cell}}]}" />
To be sure it's not a problem about the "inner" Binding, i also tried:
<Entry Text="{Binding Key, Source={x:Reference cell}}" />
This (as expected) lets Entry.Text
be Name
.
Now obviously what I want to achive is to use a Binding inside the Binding path. As the code above doesn't work (Entry.Text
is null
), I wonder if this is possible and, if yes, how?
Upvotes: 1
Views: 402
Reputation: 3274
Binding on binding won't work. Do your binding on the key with a converter.
Upvotes: 1