silverlight - Content of ContentControl in Resource -


i have contentcontrol in radtileview. if put in hard coded text content property works fine. (code below)

 <contentcontrol grid.row="2" grid.column="0" content="hello world"></contentcontrol> 

that works...if put content usercontrol.resources section application freezes , displays nothing.

<contentcontrol grid.row="2" grid.column="0" content="{staticresource tabcontrolcontent}"></contentcontrol>  <usercontrol.resources>         <textblock x:key="tabcontrolcontent" text="hello world"></textblock> </usercontrol.resources> 

ultimately have context radtabcontrol..but id settle on having textblock render.

to string contentcontrol would, add

xmlns:sys="clr-namespace:system;assembly=mscorlib" 

to usings. add this

<usercontrol.resources>         <sys:string x:key="singlestring">hello world</sys:string> </usercontrol.resources> 

which allow

<contentcontrol content="{binding source={staticresource singlestring}}"/> 

hope helps.


Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -