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.

適用於