Click here to Skip to main content
15,900,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
WPF:

HTML
<datatemplate datatype="{x:Type emp:ViewModel}">
    <emp:view />
 </datatemplate> 


In Silverlight x:Type is not found

how to implement this code in silverlight
Posted
Updated 22-Aug-12 20:59pm
v2

Hi there, in Silverlight you haven't got x:Type.

in Resources you can add:
XML
<emp:viewmodel key="vieModel" xmlns:emp="#unknown" />


Hope it helps.
 
Share this answer
 
Hi,

You would find x:Type in Silverlight 5 version(not sure which version you are using)
which is nothing but implicitly binding your bindable controls with a class of specified type.

If you are using older versions then add an entry in

<usercontrol.resources><br />
  <yourclass:yourclass x:key="yourKey" xmlns:x="#unknown" xmlns:yourclass="#unknown" /><br />
</usercontrol.resources>


and give Binding to your DataTemplate by giving the StaticResource with the x:Key.

Hope this helps.

Happy Coding!!
 
Share this answer
 
v2
Comments
suganyass 10-Sep-12 8:15am    
Thank U...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900