假设我有一个没有代码后台的简单用户控件:
<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**/>
我该如何实现这个场景?