Hi Irina, I tried your suggestion and placed everything in the root resourcedictionary. But still the datatemplates do not pick up the style.
<resourcedictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="clr-namespace:TestDataTemplateResources">
<style targettype="TextBlock">
<setter property="Background" value="Yellow" />
<setter property="FontStyle" value="Italic" />
</style>
<datatemplate datatype="{x:Type my:PersonClass}">
<border borderbrush="Blue" borderthickness="2">
<grid>
<grid.columndefinitions>
<columndefinition width="Auto" />
</grid.columndefinitions>
<grid.rowdefinitions>
<rowdefinition height="Auto" />
<rowdefinition height="Auto" />
</grid.rowdefinitions>
<textblock grid.column="0" grid.row="0" text="{Binding Name}" />
<textblock grid.column="0" grid.row="1" text="{Binding Age}" />
</grid>
</border>
</datatemplate>
<datatemplate datatype="{x:Type my:AddressClass}">
<border borderbrush="Blue" borderthickness="2">
<grid>
<grid.columndefinitions>
<columndefinition width="Auto" />
</grid.columndefinitions>
<grid.rowdefinitions>
<rowdefinition height="Auto" />
<rowdefinition height="Auto" />
</grid.rowdefinitions>
<textblock grid.column="0" grid.row="0" text="{Binding Street}" />
<textblock grid.column="0" grid.row="1" text="{Binding Zip}" />
</grid>
</border>
</datatemplate>
</resourcedictionary>