x:输入silverlight [英] x:Type in silverlight

查看:86
本文介绍了x:输入silverlight的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

WPF:

WPF:

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



在Silverlight中x:找不到类型

如何在silverlight中实现此代码



In Silverlight x:Type is not found

how to implement this code in silverlight

推荐答案

您好,在Silverlight中您没有x:Type.

在参考资料中,您可以添加:
Hi there, in Silverlight you haven''t got x:Type.

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



希望对您有所帮助.



Hope it helps.


您好,

您会在Silverlight 5版本中找到x:Type(不确定使用的版本)
这不过是将您的可绑定控件与指定类型的类隐式绑定.

如果您使用的是旧版本,请在
中添加一个条目
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>



并通过给StaticResource提供x:Key来给Binding绑定到您的DataTemplate.

希望这会有所帮助.

祝您编码愉快!



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

Hope this helps.

Happy Coding!!


这篇关于x:输入silverlight的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆