FlowDocument.FontWeight Propriété

Définition

Obtient ou définit l’épaisseur de police de niveau supérieur pour FlowDocument.

public:
 property System::Windows::FontWeight FontWeight { System::Windows::FontWeight get(); void set(System::Windows::FontWeight value); };
public System.Windows.FontWeight FontWeight { get; set; }
member this.FontWeight : System.Windows.FontWeight with get, set
Public Property FontWeight As FontWeight

Valeur de propriété

FontWeight

Membre de la classe FontWeights qui spécifie l’épaisseur de police souhaitée. La valeur par défaut est déterminée par la valeur MessageFontWeight.

Exemples

L’exemple suivant montre comment définir l’attribut FontWeight d’un FlowDocument élément.

<FlowDocumentReader>
  <FlowDocument
    FontFamily="Century Gothic"
    FontSize="12"
    FontStretch="UltraExpanded"
    FontStyle="Italic"
    FontWeight="UltraBold"
  >
    <Paragraph>
      Any font settings on this paragraph would override the font settings
      for the FlowDocument.
    </Paragraph>
  </FlowDocument>
</FlowDocumentReader>

L’exemple suivant montre comment définir la FontWeight propriété par programmation.

FlowDocument flowDoc = new FlowDocument(new Paragraph(new Run("A bit of text content...")));
// Set the desired column gap to 10 device independend pixels.
flowDoc.FontFamily = new FontFamily("Century Gothic");
flowDoc.FontSize = 12.0;
flowDoc.FontStretch = FontStretches.UltraExpanded;
flowDoc.FontStyle = FontStyles.Italic;
flowDoc.FontWeight = FontWeights.UltraBold;
Dim flowDoc As New FlowDocument(New Paragraph(New Run("A bit of text content...")))
' Set the desired column gap to 10 device independend pixels.
flowDoc.FontFamily = New FontFamily("Century Gothic")
flowDoc.FontSize = 12.0
flowDoc.FontStretch = FontStretches.UltraExpanded
flowDoc.FontStyle = FontStyles.Italic
flowDoc.FontWeight = FontWeights.UltraBold

Remarques

Tous les FontWeight paramètres des éléments enfants remplacent ce paramètre de niveau supérieur.

Informations sur les propriétés de dépendance

Champ d’identificateur FontWeightProperty
Propriétés de métadonnées définies sur true AffectsMeasure, AffectsRender, Inherits

S’applique à