绑定 Binding Path=.,Binding.,Binding Source={StaticResource ResourceKey="Hello"} xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
<Window.Resources>
<Style TargetType="TextBlock">
<Setter Property="Margin" Value="10"/>
<Setter Property="FontSize" Value="150"/>
<Setter Property="Foreground" Value="Black"/>
</Style>
</Window.Resources>
<StackPanel x:Name="stackPanel">
<StackPanel.Resources>
<sys:String x:Key="Hello">
Nice to meet you!
</sys:String>
</StackPanel.Resources>
<TextBlock Text="{Binding Path=.,Source={StaticResource ResourceKey=Hello}}"/>
<TextBlock Text="{Binding .,Source={StaticResource ResourceKey=Hello}}"/>
<TextBlock Text="{Binding Source={StaticResource ResourceKey=Hello}}"/>
</StackPanel>