码迷,mamicode.com
首页 > 其他好文 > 详细

绑定 Binding Path=.,Binding.,Binding Source={StaticResource ResourceKey="Hello"} xmlns:sys="clr-namespace:System;assembly=mscorlib"

时间:2016-10-19 17:28:09      阅读:359      评论:0      收藏:0      [点我收藏+]

标签:

 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>

绑定 Binding Path=.,Binding.,Binding Source={StaticResource ResourceKey="Hello"} xmlns:sys="clr-namespace:System;assembly=mscorlib"

标签:

原文地址:http://www.cnblogs.com/Fred1987/p/5977713.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!