silverlight - Binding to container not working, but binding to objects works -


i have following xaml (silverlight, shouldn't matter):

<listbox x:name="results"> ... </listbox> <stackpanel datacontext="{binding elementname=results, path='selecteditem.attributes'}">   <textblock text="{binding elementname=results, path='selecteditem.attributes[id]'}" />   <textblock text="{binding '[id]'}" /> </stackpanel> 

when populate listbox, second textblock populated, first textblock not. when select item listbox first textblock populated, second doesn't change.

i'm assuming i'm missing tell stackpanel's datacontext needs refresh time change selecteditem in listbox, i'm @ loss on need do.

ideally, i'd not have bind whole path each of textblocks (there going bunch of them).

gaah... found it. nitwit (you read.. me) decided it'd smart override stackpanel's datacontext when populated listbox. sorry working on this.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -