How to Access a Control present inside a DataTemplate
- by Subhen
Hi,
I have Few TextBlock inside the Data template as follow:
<DataTemplate>
<StackPanel x:Name="stackPanelItems" Orientation="Horizontal">
<TextBlock x:Name="myTextBox" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="14" />
</StackPanel>
</DataTemplate>
Now we need to Make the myTextBox Collsapsed in some scenarios but dont want to use the loaded or click event and then access the control via sender.
Can I used any other method or way?
Thanks,
Subhen