xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
该 url 如何映射到 .NET 命名空间?您能否举例说明如何对自定义 .NET 类/命名空间执行相同的操作?它是一个必须在名称空间本身上定义的属性吗?
或者是使用 C# 别名的问题吗?:
using alias = FullNamespace
映射是使用XmlnsDefinition http://msdn.microsoft.com/en-us/library/system.windows.markup.xmlnsdefinitionattribute.aspx属性。例如 :
[assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "System.Windows.Data")]
[assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "System.Windows")]
[assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "System.Windows.Controls.Primitives")]
[assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "System.Windows.Media.Animation")]
[assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "System.Windows.Input")]
(使用 Reflector 提取的PresentationFramework.dll 中的代码)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)