Бөлісу құралы:


FlowDocument.Foreground Свойство

Определение

Возвращает или задает Brush значение, применяемое к текстовому содержимому объекта 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

Значение свойства

Кисть, используемая для применения к содержимому текста. Значение по умолчанию — Black.

Примеры

В следующем примере показано, как задать Foreground атрибут FlowDocument элемента.

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

В следующем примере показано, как программно задать свойство Foreground.

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

Комментарии

Сведения о таблицах с образцами, где показаны доступные предопределенные цвета кисти, см. в разделе Brushes.

Все Foreground параметры дочерних элементов переопределяют этот параметр верхнего уровня.

Сведения о свойстве зависимостей

Элемент Ценность
Поле идентификатора ForegroundProperty
Свойства метаданных, равные свойству true Microsoft.Authorization/*/write, , Microsoft.Network/vpnGateways/*

SubPropertiesDoNotAffectRender

Применяется к