FlowDocument.FontWeight FlowDocument.FontWeight FlowDocument.FontWeight FlowDocument.FontWeight Property

Definición

Obtiene o establece el grosor de fuente de nivel superior para FlowDocument.Gets or sets the top-level font weight for the 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

Valor de propiedad

Un miembro de la clase FontWeights que especifica el espesor de fuente deseado.A member of the FontWeights class that specifies the desired font weight. El valor predeterminado viene determinado por el valor de MessageFontWeight.The default is determined by the MessageFontWeight value.

Ejemplos

El ejemplo siguiente muestra cómo establecer el FontWeight atributo de un FlowDocument elemento.The following example shows how to set the FontWeight attribute of a FlowDocument element.

<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>

El ejemplo siguiente muestra cómo establecer el FontWeight propiedad mediante programación.The following example shows how to set the FontWeight property programmatically.

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

Comentarios

Cualquier FontWeight en elementos secundarios invalida esta configuración de nivel superior.Any FontWeight settings on child elements override this top-level setting.

Información sobre propiedades de dependenciaDependency Property Information

Campo de identificadorIdentifier field FontWeightProperty
Establecen las propiedades de metadatos en trueMetadata properties set to true AffectsMeasure, AffectsRender, InheritsAffectsMeasure, AffectsRender, Inherits

Se aplica a