Silverlight {绑定密钥} - 请刷新我的记忆?
我确信这很简单,但是我到底错过了什么?有人可以告诉我 Text="{Binding Key}"
中关键字“Key”引用的是什么吗?我知道我以前学过,但我似乎不记得了。我了解数据绑定的工作原理,只是停留在这个特定问题上。
<DataTemplate x:Key="groupItemHeader">
<Border Background="{StaticResource PhoneAccentBrush}"
Width="432" Height="62"
Margin="6" Padding="12,0,0,6">
<TextBlock Text="{Binding Key}"
Foreground="#FFFFFF" FontSize="26.667"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
FontFamily="{StaticResource PhoneFontFamilySemiBold}"/>
<Border.Projection>
<PlaneProjection RotationX="-60"/>
</Border.Projection>
</Border>
</DataTemplate>
I'm sure this is simple, but what the hell am I missing here? Can someone tell me what the keyword "Key" is referencing in Text="{Binding Key}"
? I know I learned about it previously, but I cannot seem to remember. I understand how databinding works, just stuck on this particular issue.
<DataTemplate x:Key="groupItemHeader">
<Border Background="{StaticResource PhoneAccentBrush}"
Width="432" Height="62"
Margin="6" Padding="12,0,0,6">
<TextBlock Text="{Binding Key}"
Foreground="#FFFFFF" FontSize="26.667"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
FontFamily="{StaticResource PhoneFontFamilySemiBold}"/>
<Border.Projection>
<PlaneProjection RotationX="-60"/>
</Border.Projection>
</Border>
</DataTemplate>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
{Binding Key}
是{Binding Path=Key}
的简写。这将返回当前DataContext
上的Key
属性的值。{Binding Key}
is shorthand for{Binding Path=Key}
. This will return the value of theKey
property on the currentDataContext
.