FrameworkTemplate.FindName(String, FrameworkElement) FrameworkTemplate.FindName(String, FrameworkElement) FrameworkTemplate.FindName(String, FrameworkElement) FrameworkTemplate.FindName(String, FrameworkElement) Method

定义

查找与在此模板中定义的指定名称相关联的元素。Finds the element associated with the specified name defined within this template.

public:
 System::Object ^ FindName(System::String ^ name, System::Windows::FrameworkElement ^ templatedParent);
public object FindName (string name, System.Windows.FrameworkElement templatedParent);
member this.FindName : string * System.Windows.FrameworkElement -> obj
Public Function FindName (name As String, templatedParent As FrameworkElement) As Object

参数

name
String String String String

字符串名称。The string name.

templatedParent
FrameworkElement FrameworkElement FrameworkElement FrameworkElement

要应用此模板的 FrameworkElement 的上下文。The context of the FrameworkElement where this template is applied.

返回

与指定名称相关联的元素。The element associated with the specified name.

注解

有关详细信息, 请参阅WPF Xaml 名称范围中的 "样式和模板中的 XAML 名称范围"。For more information, see "XAML Namescopes in Styles and Templates" in WPF XAML Namescopes.

适用于