Gets or sets the font size for the text content in this element.
Assembly: System.Windows (in System.Windows.dll)
Dependency property identifier field: FontSizeProperty
For best results, specify integer values for , even though the property technically accepts floating-point values.
In Windows Presentation Foundation (WPF), the XAML values for can include a unit qualifier such as "pt" or "px". However, these unit qualifiers are not supported in Silverlight. You can specify only a numeric value, which is always interpreted as pixels. If you are importing XAML UI definitions from WPF, you might need to modify the attribute values to remove the unit qualifiers, or convert the units.
The following XAML example shows how to use the property to define several text strings that are formatted differently.
<TextBlock FontFamily="Arial" Width="400" Text="Sample text formatting runs"> <LineBreak/> <Run Foreground="Maroon" FontFamily="Courier New" FontSize="24">Courier New 24</Run> <LineBreak/> <Run Foreground="Teal" FontFamily="Times New Roman" FontSize="18" FontStyle="Italic">Times New Roman Italic 18</Run> <LineBreak/> <Run Foreground="SteelBlue" FontFamily="Verdana" FontSize="14" FontWeight="Bold">Verdana Bold 14</Run> </TextBlock>
The following illustration shows how the text from the previous example is rendered.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.