如何在数据绑定源中选择不同的数据模板来填充字段? 我有2周不同的DataTemplatesWPF中的条件数据模板
<DataTemplate x:Key="DataTemplateLabel">
<Label Width="60" Height="25" Background="Red">
<TextBlock Text="{Binding Path=Name}"/>
</Label>
</DataTemplate>
<DataTemplate x:Key="DataTemplateTxtBox">
<TextBox Width="60" Height="25" Background="Red" Text="{Binding Path=Text}"/>
</DataTemplate>
如果(ISTEXT)然后使用DataTemplateTxtBox ELSE使用DataTemplateLabel)这可能吗? 谢谢。