XMAL中的x是何方神僧


在一开始我们接触WPF时,总是被小X牵着鼻子走,还不知道它是谁,比如


        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Blend_WPF"
        mc:Ignorable="d" Style="{DynamicResource NoBorderAndCorner}" >
   
        x:Name="Btn" HorizontalAlignment="Left" Margin="248.5,175,0,0" VerticalAlignment="Top" Width="75" Height="{x:Static SystemParameters.IconGridHeight}" Content="{Binding Path=Height,RelativeSource={RelativeSource Mode=Self}}"/>

   

细查资料才知道,在XAML语言中,为了区别关键字,所以特别有一个约定,用小X来标记http://schemas.microsoft.com/winfx/2006/xaml)

比如,本来C#语言中的关键字class,在XAML语言中就是x:Class

其他的类似,什么x:Key啊、x:Name啊、x:Uid哈哈