Wpf XAML的新功能。x:and:x是什么意思?
我是XAML的新手。我想知道所有的x:And:x都是关于什么的。关于XAML的教程并没有解释这一点(或者我还没有读够) 例如:Wpf XAML的新功能。x:and:x是什么意思?,wpf,xaml,Wpf,Xaml,我是XAML的新手。我想知道所有的x:And:x都是关于什么的。关于XAML的教程并没有解释这一点(或者我还没有读够) 例如: <Window x:Class="WpfTutorialSamples.WPF_Application.ResourceSample" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft
<Window x:Class="WpfTutorialSamples.WPF_Application.ResourceSample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Title="ResourceSample" Height="150" Width="350">
<Window.Resources>
<sys:String x:Key="strHelloWorld">Hello, world!</sys:String>
</Window.Resources>
<StackPanel Margin="10">
<TextBlock Text="{StaticResource strHelloWorld}" FontSize="56" />
<TextBlock>Just another "<TextBlock Text="{StaticResource strHelloWorld}" />" example, but with resources!</TextBlock>
</StackPanel>
</Window>
你好,世界!
只是另一个“”示例,但有资源!
在这些行中x是什么意思
- Windowx:Class=“wpfutorialsamples.WPF\u应用程序.ResourceSample”
- xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml“sys:String
- x:Key=“strelloworld”>你好,世界!
x
映射到http://schemas.microsoft.com/winfx/2006/xaml
名称空间:
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
有关XAML命名空间和命名空间映射的更多信息,请参阅MSDN
WPF XAML的XAML名称空间和名称空间映射:
如果您想:
如前所述,它只是映射到名称空间的前缀,以便您能够在XAML标记中使用名称空间中定义的类型或属性