Hi all,
the below code just be test code to bind its child property background, but it does not work. I just want to use RelativeSource way, but no by elementname. Since I would like to use it in datagrid, so here just a test. thanks.
<Canvas>
<StackPanel Height="200" Width="200" HorizontalAlignment="Left" Background="{Binding Path=Children[0].Background, RelativeSource={RelativeSource Self}}" Panel.ZIndex="1" Canvas.Left="-50">
<StackPanel Height="50" Width="180" Background="Red" Panel.ZIndex="10" Margin="100,0,0,0" ></StackPanel>
</StackPanel>
</Canvas>