How would you select a different data file that adjusts to the field in the data binding source? I would have two different DataTemplates
<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>
if (isText) Then use the DataTemplateTxtBox ELSE using the DataTemplateLabel) Is this possible? Thanks.
wpf binding datatemplate
Eli perpinyal
source share