You can use the FindName() method of the ControlTemplate class.
// Finding the grid that is generated by the ControlTemplate of the Button
Grid gridInTemplate = (Grid)myButton1.Template.FindName("grid", myButton1);
More Related Contents:
- How can I find WPF controls by name or type?
- In WPF, why doesn’t TemplateBinding work where Binding does?
- How to fix this behavior in a WPF TabControl?
- How to make overlay control above all other controls?
- How to change disabled background color of TextBox in WPF
- Where is the WPF Numeric UpDown control?
- Creating an image+text button with a control template?
- How to Stretch WPF Tab Item Headers to Parent Control Width
- What is the best way to simulate a Click with MouseUp & MouseDown events or otherwise?
- WPF TextBox and Scroll behavior
- Template Binding in Control template
- How to change MahApps.Metro dialog content template width?
- WPF ComboBox without drop-down button
- ComboBox Dropdown when Mouse Enter WPF
- How to bind multiple values to a single WPF TextBlock?
- What is so special about Generic.xaml?
- How to define TextBox input restrictions?
- How to set default WPF Window Style in app.xaml?
- How can I paginate a WPF DataGrid?
- WPF calling commands via events
- How to disable highlighting on listbox but keep selection?
- WPF VirtualizingStackPanel for increased performance
- WPF: Display a bool value as “Yes” / “No”
- Clicking HyperLinks in a RichTextBox without holding down CTRL – WPF
- WPF ListView turn off selection
- Create flat button in WPF
- How to fix the WPF form resize – controls lagging behind and black background?
- WPF MouseLeftButtonUp Not Firing
- Customizing the TreeView to allow multi select
- How to set the style programmatically