Retrieves the named element in the instantiated ControlTemplate visual tree.
Protected Function GetTemplateChild ( _ childName As String _ ) As DependencyObject
Dim childName As String Dim returnValue As DependencyObject returnValue = Me.GetTemplateChild(childName)
protected DependencyObject GetTemplateChild( string childName )
Templates in Silverlight 2 have a self-contained namescope. This is because templates are re-used, and any name defined in a template cannot remain unique once multiple instances of a control each instantiate their template. Call GetTemplateChild in order to return references to objects that come from the template after it is instantiated. You cannot use FindName to find items from templates because FindName acts in a more general scope, and there is no connection between the ControlTemplate class itself and the instantiated template once it is applied.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.