第一行:<Windowsxy:Class=”FirstWpfApplication.Windows1”
第二行: xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
第三行: xmlns:xy=”http:// schemas.microsoft.com/winfx/2006/xaml”
第四行: title=”Windows1”Height=”300”Width=”300”>
<Grid></Grid>
</Windows>
(1)xy:Class=”FirstWpfApplication.Windows1”这句话中的xy:前缀说明Class这个属性来自xy映射的对应的XAML解析功能的名称空间。Class是在xy对应的名称空间中定义好的,不能随便改名字,例如改成xy:Classabc=”FirstWpfApplication.Windows1”就不行,因为Classabc在xy对应到名称空间中没有定义
(2)第一行表示在使用名为Class的Attribute,这个Attribute来自于前缀xy:所对应的名称空间。
(3)<Windows/><Grid/>都来自由第二行声明的无名称默认名称空间,所以前边不用加前缀。
(4)第三行是声明名称为xy的前缀,第一行是调用名称为xy的前缀。