Defining a DataTemplateBase I have defined some DataTemplates are similar. The templates are like this:

    &lt;DataTemplate x:Key="DefaultCellTemplate"&gt;
    &lt;TextBlock Text="{Binding Value}"&gt;
        &lt;i:Interaction.Behaviors&gt;
            &lt;beh:AddErrorButtonAdornerToControlsBehavior 
                DoOnButtonClick="{Binding RelativeSource={RelativeSource AncestorType={x:Type dxg:GridControl}}, Path=DataContext.ShowErrorDialogCommand}" 
                FieldDescriptionId="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type dxg:GridCellContentPresenter}}, Path=Column.Tag}"/&gt;
        &lt;/i:Interaction.Behaviors&gt;
    &lt;/TextBlock&gt;
&lt;/DataTemplate&gt;

&lt;DataTemplate x:Key="TimeCellTemplate"&gt;
    &lt;TextBlock Text="{Binding Value, Converter={StaticResource TimeConverter}}"&gt;
        &lt;i:Interaction.Behaviors&gt;
            &lt;beh:AddErrorButtonAdornerToControlsBehavior 
                DoOnButtonClick="{Binding RelativeSource={RelativeSource AncestorType={x:Type dxg:GridControl}}, Path=DataContext.ShowErrorDialogCommand}" 
                FieldDescriptionId="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type dxg:GridCellContentPresenter}}, Path=Column.Tag}"/&gt;
        &lt;/i:Interaction.Behaviors&gt;
    &lt;/TextBlock&gt;
&lt;/DataTemplate&gt;

&lt;DataTemplate x:Key="StationCellTemplate"&gt;
    &lt;TextBlock Text="{Binding Value, Converter={StaticResource StationConverter}}"&gt;
        &lt;i:Interaction.Behaviors&gt;
            &lt;beh:AddErrorButtonAdornerToControlsBehavior 
                DoOnButtonClick="{Binding RelativeSource={RelativeSource AncestorType={x:Type dxg:GridControl}}, Path=DataContext.ShowErrorDialogCommand}" 
                FieldDescriptionId="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type dxg:GridCellContentPresenter}}, Path=Column.Tag}"/&gt;
        &lt;/i:Interaction.Behaviors&gt;
    &lt;/TextBlock&gt;
&lt;/DataTemplate&gt;

&lt;DataTemplate x:Key="ProductionCategoryCellTemplate"&gt;
    &lt;TextBlock Text="{Binding Value, Converter={StaticResource ProductionCategoryConverter}}"&gt;
        &lt;i:Interaction.Behaviors&gt;
            &lt;beh:AddErrorButtonAdornerToControlsBehavior 
                DoOnButtonClick="{Binding RelativeSource={RelativeSource AncestorType={x:Type dxg:GridControl}}, Path=DataContext.ShowErrorDialogCommand}" 
                FieldDescriptionId="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type dxg:GridCellContentPresenter}}, Path=Column.Tag}"/&gt;
        &lt;/i:Interaction.Behaviors&gt;
    &lt;/TextBlock&gt;
&lt;/DataTemplate&gt;


I don't know, if I can define a template base. The template base should be a TextBlock with the behavior and the derived templates should be use a converter for the TextBlock value. Any idea?
Real inheritance is not possible in DataTemplate through XAML, as far as I know. What you can do with is use a nested construction of DataTemplates.

The method boils down to using a ContentPresenter and setting the ContentTemplate property in order to achieve your nesting.

Solutions are already presented on SO and Google; both give a good bit of information:


Stack Overflow
Stack Overflow
Google