Accessing other controls by name in a Silverlight ControlTemplate
- by Chris S
I have a custom control that inherits from ContentControl. Inside the generic.xaml file is a simple Grid with 2 rows:
Row 1 - A toggle button
Row 2 - A StackPanel with a TextBlock, named "Stackpanel1"
The ToggleButton has its own nested ControlTemplate which has VisualStates for Checked/Unchecked.
Is it possible to reference "Stackpanel1" from inside the ToggleButton's control template somehow? In order to show or hide the stackpanel.