I am trying to bind a property of an element within a UserControl to a property set on the UserControl itself in Silverlight. I'm sure it should be simple, but I haven't managed to get it working with either RelativeSource or ElementName binding. In this example I want the Rectangle to be Green (or whatever the UserControl's Background property gets set to).
<UserControl x:Class="MyUserControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="40" Height="40" Background="Green" x:Name="root">
<Grid x:Name="LayoutRoot" Background="White">
<Rectangle x:Name="indicatorRectangle" Fill="{Binding Path=Background, ElementName=root}" Margin="0,0,26,0" />
</Grid>
</UserControl>
anyone know the correct binding syntax?