WPF Binding妙处-既无Path也无Source
<Window x:Class="XamlTest.Window12"
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="Window12" Height="300" Width="300">
<Grid>
<Grid.DataContext>
<sys:String>Hello</sys:String>
</Grid.DataContext>
<StackPanel>
<TextBlock Text="{Binding}"></TextBlock>
</StackPanel>
</Grid>
</Window>
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="Window12" Height="300" Width="300">
<Grid>
<Grid.DataContext>
<sys:String>Hello</sys:String>
</Grid.DataContext>
<StackPanel>
<TextBlock Text="{Binding}"></TextBlock>
</StackPanel>
</Grid>
</Window>