Search code examples
xamlxamarin.forms

How to set FontAttributes within XAML to both Bold and Italic?


In Xamarin.Forms, how do I set FontAttributes within XAML to both Bold and Italic?

Example:

  <Style TargetType="Label">
    <Setter Property="FontAttributes" Value="Bold" />
    <Setter Property="FontAttributes" Value="Italic" />
  </Style>

Solution

  • <Style TargetType="Label">
      <Setter Property="FontAttributes" Value="Bold, Italic" />
    </Style>
    

    FontAttributes is a Flag, so you can pass multiple values.