Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WPF-是否<;?测绘>;用过了吗?_Wpf_Namespaces_Assemblies_Xml Namespaces - Fatal编程技术网

WPF-是否<;?测绘>;用过了吗?

WPF-是否<;?测绘>;用过了吗?,wpf,namespaces,assemblies,xml-namespaces,Wpf,Namespaces,Assemblies,Xml Namespaces,基本上,我记得曾经有一段时间您可以使用以下内容:似乎仍然无法在WPF项目中映射本地名称空间。该书(2007年出版)指出: Visual Studio中的WPF项目不能使用由位于同一程序集中的XAML中的xmlnDefinitionAttribute引入的名称空间。如果要引用本地定义的类型,必须使用替代机制 “替代机制”是每个名称空间的可怕的xmlns:local=“…” 我的理解是,执行程序集(在本例中为本地WPF程序集)在所有引用的程序集中搜索xmlnprefixattribute和xmlnd

基本上,我记得曾经有一段时间您可以使用以下内容:
似乎仍然无法在WPF项目中映射本地名称空间。该书(2007年出版)指出:

Visual Studio中的WPF项目不能使用由位于同一程序集中的XAML中的
xmlnDefinitionAttribute
引入的名称空间。如果要引用本地定义的类型,必须使用替代机制

“替代机制”是每个名称空间的可怕的
xmlns:local=“…”


我的理解是,执行程序集(在本例中为本地WPF程序集)在所有引用的程序集中搜索
xmlnprefixattribute
xmlndefinitionattribute
,但不搜索自身。4年后,这种行为没有改变是毫无意义的,但事实似乎如此。

我个人从未在标签上看到过任何东西,也不记得曾经看到过它被引用过。和你一样,我也找不到关于它的任何东西,无论是过去还是现在。我终于在上面找到了一个MSDN论坛帖子,等等。。。但不是对它的实际引用:
xmlns:xyzcon="clr-namespace:XYZ.Wpf.Controls"
xmlns:xyzcom="clr-namespace:XYZ.Wpf.Commands"
[assembly: XmlnsPrefix("http://schemas.mycompany.com/netfx/xaml/presentation", "xyz")]
[assembly: XmlnsDefinition("http://schemas.mycompany.com/netfx/xaml/presentation", "XYZ.Wpf.Controls")]
[assembly: XmlnsDefinition("http://schemas.mycompany.com/netfx/xaml/presentation", "XYZ.Wpf.Commands")]
xmlns:xyz="http://schemas.mycompany.com/netfx/xaml/presentation"