<Grid><Grid.Resources><Style TargetType="TextBlock"><Setter Property="FontSize" Value="16"/></Style></Grid.Resources><ListBox FontSize="8"><ListBox.ItemTemplate><DataTemplate><StackPanel><TextBlock Text="TextBlock" /></StackPanel></DataTemplate></ListBox.ItemTemplate><sys:Int32 xmlns:sys="clr-namespace:System;assembly=mscorlib">1</sys:Int32></ListBox></Grid>
I expect the font of the textblock should be 16, instead of 8, because in the dependency property precedence, style setter is higher than property value inheritance. But the result is 8. Would someone please help me to understand this behavior? Thanks in advance.
↧
Property Value Precedence Question for TextBlock
↧