Freezable DataContext
- by grid-wpf-architect
Hi,
I have a customControl like ListView and I need to bind the sub property of my Custom Control to the visual tree element like below,
<StackPanel>
<TextBlock Text="Test" x:Name="txtBlock" />
<local:MyControl>
<local:MyControl.Items>
<local:MyControlItem Value ="{Binding ElementName=txtBlock, Path=Text}" />
</local:MyControl.Items>
</local:MyControl>
</StackPanel>
I can access the object using Freezable object as the resource, but i want to inherit Freezable in my MyControlItem and access the Visual Tree.