microsoft metro - WinRT XAML ItemsControl Children binding -



microsoft metro - WinRT XAML ItemsControl Children binding -

i have next xaml:

<itemscontrol itemssource="{binding datacontext}"> <itemscontrol.itemtemplate> <datatemplate> <local:mycontrol datacontext="{binding}"/> </datatemplate> </itemscontrol.itemtemplate> <itemscontrol.itemspanel> <itemspaneltemplate> <stackpanel orientation="horizontal"/> </itemspaneltemplate> </itemscontrol.itemspanel> </itemscontrol>

how set datacontext of mycontrol single item of itemscontrol?

note: itemscontrol embedded in usercontrol. usercontrol has it's datacontext property set in place it's beingness used.

figured out:

<itemscontrol itemssource="{binding}"> <itemscontrol.itemtemplate> <datatemplate> <local:mycontrol datacontext="{binding}"/> </datatemplate> </itemscontrol.itemtemplate> <itemscontrol.itemspanel> <itemspaneltemplate> <stackpanel orientation="horizontal"/> </itemspaneltemplate> </itemscontrol.itemspanel> </itemscontrol>

just changed {binding datacontext} {binding}

xaml microsoft-metro windows-runtime itemscontrol

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -