次の単純化されたコードが TextBlock の font-size を 50 に設定しないのはなぜですか?
<Window.Resources>
<ControlTemplate TargetType="ContentControl" x:Key="Test">
<ContentPresenter TextBlock.FontSize="50" />
</ControlTemplate>
</Window.Resources>
<Grid>
<ContentControl Template="{StaticResource Test}">
<TextBlock>Test should be rendered big</TextBlock>
</ContentControl>
</Grid>
FontSize プロパティの値を変更すると、Visual Studio は必要なサイズでテキストを表示します。アプリをコンパイルまたは実行した後、テキストブロックのサイズは常に既定のサイズにリセットされます。
スタイルと埋め込みリソースを使用してさまざまなバージョンもテストしましたが、ContentPresenter を含む ControlTemplate 内から添付された dp を継承するように設定できないという状況で常に終了します。これは設計によるものですか?