コンテンツコントロールのテンプレートを定義するスタイルがあります。
contentプロパティがnullのすべてのコントロールについて、コントロールが空であることを示すテキストを表示したいのですが、以下のxamlが機能していません。理由を知っている人はいますか?
<Style TargetType="ContentControl" x:Key="style">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Content, RelativeSource={RelativeSource Self}}" Value="{x:Null}">
<Setter Property="ContentControl.Template">
<Setter.Value>
<ControlTemplate>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<TextBlock Background="Blue">EMPTY!</TextBlock>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
<ContentControl Content="{x:Null}" Style="{StaticResource style}" />
「EMPTY!」というテキストは表示されません。