c# - Silverlight: Access parent data context from DataTemplate? -
i'm using silverlight 4. have itemscontrol
custom datatemplate
. datatemplate
, bind in usercontrol
's datacontext
- not datacontext
of specific element in items control. there way this?
this should answer question : access parent datacontext datatemplate
<itemscontrol x:name="level1lister" itemssource={binding mylevel1list}> <itemscontrol.itemtemplate> <datatemplate> <button content={binding mylevel2property} command={binding elementname=level1lister, path=datacontext.mylevel1command} commandparameter={binding mylevel2property}> </button> <datatemplate> <itemscontrol.itemtemplate> </itemscontrol>
Comments
Post a Comment