Yocoder is right,
Inside the DataTemplate
, your DataContext
is set to the Rule
its currently handling..
To access the parents DataContext
, you can also consider using a RelativeSource
in your binding:
<TextBlock Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ____Your Parent control here___ }}, Path=DataContext.SelectedRule.Name}" />
More info on RelativeSource
can be found here:
http://msdn.microsoft.com/en-us/library/system.windows.data.relativesource.aspx