使用这个属性让代码更酷一点
(一)
<Page x:Class="Test" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:h="clr-namespace:DH.Class1;assembly=dhLib" />
所有http://schemas.microsoft.com/winfx/2006/xaml/presentation命名空间映射到他们所介绍的CLR命名空间。原因可以在自己的项目中使用这个属性,只需打开AssemblyInfo.cs文件,并追加以下代码:
[assembly: XmlnsDefinition("http://www.dh.com/xaml/", "DH.Class1")]
(二)
<Page x:Class="Test" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:h="http://www.dh.com/xaml/" />
XmlnsDefinitionAttribute
最新推荐文章于 2023-08-02 09:30:09 发布