如何在DataTemplate中将文本框的文本属性绑定到ContentControl的内容属性?(不使用ElementName进行绑定)
以下是我的代码(但它无法正常工作):
以下是我的代码(但它无法正常工作):
<Window.Resources>
<DataTemplate x:Key="Temp">
<TextBox TextWrapping="Wrap" Text="{TemplateBinding Content}" Height="20" Width="Auto"/>
</DataTemplate>
</Window.Resources>
<Grid>
<ContentControl ContentTemplate="{DynamicResource Temp}" Content="1"/>
</Grid>