天天看点

silverlihgt xmlns 命名空间

默认的命名空间

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     silverlight的核心命名空间

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   xaml语言的命名空间

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  设计时相关的命名空间

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  xml交互性的命名空间,告诉xml语法,哪些需要处理,哪些可以忽略。

自定义类库的命名空间:

1.一般的添加方式

xmlns:my="clr-namespace:XXX;assembly=XXXX"

2. url的添加方式,可合并多个类库:

    在类库的AssemblyInfo.cs中添加下面属性,

using System.Windows.Markup; 

[assembly: XmlnsDefinitionAttribute("http://www.url.com", "NameSpaceUrl", AssemblyName = "NameSpaceUrl")]

在引有的工程头部

 xmlns:my="http://www.url.com"