以下のコードを使用しました
<DataTemplate x:Key="myTemplate">
<TextBlock Text="Hi"></TextBlock>
</DataTemplate>
この場合、以下のコードを使用してテキストブロックのテキストを取得できます
DataTemplate myTemplate = this.Resources["myTemplate"] as DataTemplate;
TextBlock rootElement = myTemplate.LoadContent() as TextBlock;
//I can get the text "rootElement.text "
しかし、バインディングを使用すると、テキストを取得できません
<DataTemplate x:Key="myTemplate">
<TextBlock Text="{Binding EmployeeName}"></TextBlock>
</DataTemplate>