Freezable DataContext
Posted
by grid-wpf-architect
on Stack Overflow
See other posts from Stack Overflow
or by grid-wpf-architect
Published on 2010-04-22T15:28:32Z
Indexed on
2010/04/23
23:43 UTC
Read the original article
Hit count: 284
wpf
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.
© Stack Overflow or respective owner