首页 > 其他 > 详细

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

时间:2016-10-19 17:25:24      阅读:1137      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!