WP7自定义命名空间和前缀

时间:2011-05-26 20:12:20

标签: c# silverlight windows-phone-7

我遇到了这个网页,关于如何在Silverlight中使用更清晰的命名空间 http://www.codeproject.com/KB/silverlight/xaml_custom_namespaces.aspx

有人知道这对WP7是否也适用?

当我尝试它时,我收到一条消息“无法找到类型或命名空间名称'myclassname'”

这就是我在AssemblyInfo.cs中所拥有的:

//Map all Namespaces in the project to the IQ prefix  
[assembly: XmlnsPrefix("http://schemas.myapp.com/wp7/", "iq")]  
[assembly: XmlnsDefinition("http://schemas.myapp.com/wp7/", "MyApp.Controls")]

在我的页面中:

xmlns:iq="http://schemas.myapp.com/wp7/"

1 个答案:

答案 0 :(得分:4)

将C#命名空间映射到您自己的程序集的字符串(通常是URI)是Silverlight 4 feature。 WP7的Silverlight基于Silverlight 3,因此很可能不存在此功能。

相关问题