Partilhar via


FlowDocument.Foreground Propriedade

Definição

Obtém ou define a Brush aplicação ao conteúdo de texto do FlowDocument.

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

Valor da propriedade

O pincel usado para aplicar ao conteúdo do texto. O padrão é Black.

Exemplos

O exemplo a seguir mostra como definir o Foreground atributo de um FlowDocument elemento.

<FlowDocumentReader>
  <FlowDocument 
    Background="IndianRed"
    Foreground="NavajoWhite"
  >
    <Paragraph>
      This FlowDocument will have a background color of Indian red, with the text
      colored Navajo white.  Any Forground or Background settings on this paragraph
      would override the top-level settings for the FlowDocument.
    </Paragraph>
  </FlowDocument>
</FlowDocumentReader>

O exemplo a seguir mostra como definir a propriedade Foreground programaticamente.

FlowDocument flowDoc = new FlowDocument(new Paragraph(new Run("A bit of text content...")));
flowDoc.Background = Brushes.IndianRed;
flowDoc.Foreground = Brushes.NavajoWhite;
Dim flowDoc As New FlowDocument(New Paragraph(New Run("A bit of text content...")))
flowDoc.Background = Brushes.IndianRed
flowDoc.Foreground = Brushes.NavajoWhite

Comentários

Para obter uma tabela de amostras que mostra as cores de pincel predefinidas disponíveis, consulte Brushes.

Todas as Foreground configurações em elementos filho substituem essa configuração de nível superior.

Informações da propriedade Dependency

Item Valor
Campo identificador ForegroundProperty
Propriedades de metadados definidas como true Microsoft.Authorization/*/write, Microsoft.Network/vpnGateways/*,

SubPropertiesDoNotAffectRender

Aplica-se a