3
如何将datatemplate中的textbox文本属性绑定到ContentControl Content属性?
(不通过的ElementName bindng)将数据绑定到ContentControl的内容
这是我的代码(即不工作):
<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>