3
比方说,我有一个简单的用户控件没有代码隐藏:如何绑定UserControl属性?
<UserControl
xmlns= ....
x:Class="TrafficLight.LightControl">
<Grid x:Name="LayoutRoot">
<Grid x:Name="Light" >
<Ellipse x:Name="MyColor" Fill="{**I need bind this field to UserControl.Foreground**}" Stroke="#FF000000" />
<Ellipse x:Name="Shade" Fill="#E4555555" />
</Grid>
</Grid>
而且在页面上使用此用户控件:
<TrafficLight:LightControl x:Name="red" Foreground="#FFFEF100" **<= I need to bind MyColor.Fill with this property**/>
如何,我可以实现这个场景?
谢谢。我尝试使用它,但没有效果。 <椭圆X:名称= “彩色”> –
FFire
2009-04-08 04:23:58
嗯,这是一个耻辱。今天晚些时候我会试着看看,看看我们是否不能为你排序。 :) – 2009-04-08 14:19:31