Bla*_*ord 3 wpf font-size expression-blend
我在网格中有一个标签,我从资源字典中应用了一个样式.除其他外,样式将标签的FontSize属性更改为14.
<Style x:Key="lblForm" TargetType= "{x:Type Label}">
<Setter Property="FontSize" Value="14"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="0,0,6,0"/>
</Style>
Run Code Online (Sandbox Code Playgroud)
我以下列方式将样式应用于标签:
<Label x:Name="lblFirstName" Content="First name:" Style="{StaticResource lblForm}" Grid.Row="1"/>
Run Code Online (Sandbox Code Playgroud)
当我检查在Blend中的设计相同的标签元素,将字号属性是不相同集的风格.例如,当样式中的FontSize属性设置为14时,设计者说FontSize为10.5.如果我在样式中增加FontSize属性,当我在设计器中查看它时它也会增加,但它永远不会相同.为什么会这样?