Application.Resources などの親側の Resource で x:key なしの TargetType 指定したスタイルを、Window.Resources などの子側で継承したい場合のやり方。
その TargetType の型をそのまま継承すればよいようです。
<Window.Resources>
<Style TargetType="DataGrid" BasedOn="{StaticResource {x:Type DataGrid}}">
<Setter Property="IsReadOnly" Value="True"/>
</Style>
</Window.Resources>
たとえば、以下のような xaml を記述します。
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="200" Width="200">
<Window.Resources>
<Style TargetType="Button">
<Setter Property="Background" Value="LightGreen"/>
</Style>
</Window.Resources>
<StackPanel>
<Grid>
<!-- 親要素(Window.Resources) の Style が反映される -->
<Button Content="Button"/>
</Grid>
<Grid>
<Grid.Resources>
<!-- BasedOn がないと Window.Resources での設定が反映されない -->
<Style TargetType="Button">
<Setter Property="Foreground" Value="White"/>
</Style>
</Grid.Resources>
<Button Content="Button"/>
</Grid>
<Grid>
<Grid.Resources>
<!-- BasedOn を付加すると親要素(Window.Resources) の Style が反映される -->
<Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Foreground" Value="White"/>
</Style>
</Grid.Resources>
<Button Content="Button"/>
</Grid>
</StackPanel>
</Window>
すると表示は以下のようになります。
一番上の Button は Window.Resources の Style の通り背景色が緑で表示されます。
しかし、その下の Button は Grid.Resources で文字色を設定したために、背景色がデフォル(灰色)に戻ってしまっています。
一番下の Button は、BasedOn により親の Style を継承しているので、背景色は緑のまま、文字色を白にすることができています。
