binding - Set Properties of object in ContentControl DataTemplate within Silverlight -


i need access properties of object, cougar, in code behind. set value of drink yellow. i'm not sure how access cougar object in code behind. thanks

<contentcontrol x:name="ccprogress" grid.row="0" grid.columnspan="3" horizontalcontentalignment="left" content="{binding}">             <contentcontrol.contenttemplate>                 <datatemplate x:name="dtprogress">                     <local:cougar x:name="localprogress" drink="brown">                      </local:cougar>                 </datatemplate>             </contentcontrol.contenttemplate>         </contentcontrol> 

those 2 links may you:

http://pwnedcode.wordpress.com/2009/04/01/find-a-control-in-a-wpfsilverlight-visual-tree-by-name/

http://abubakar-dar.blogspot.com/2010/09/find-control-inside-silverlight.html

http://www.mostlydevelopers.com/mostlydevelopers/blog/post/2009/06/17/get-child-parent-or-children-objects-in-silverlight.aspx

uses visualtreehelper traverse tree , find control name.

you using loaded event of cougar control, if has one.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -