FlowDocument.PagePadding プロパティ

定義

ページの境界とページのコンテンツとの間に埋め込むスペースの幅を示す値を取得または設定します。

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

プロパティ値

適用する余白の量を指定する Thickness 構造体。デバイス非依存のピクセル単位で指定します。 既定では 0 (0.0) の均一の幅です。

次の例では、要素の属性を設定 PagePadding するさまざまな方法を FlowDocument 示します。

<FlowDocumentReader>
  <FlowDocument PagePadding="10">
    <Paragraph>Padding is 10 pixels all around.</Paragraph>
  </FlowDocument>
</FlowDocumentReader>

<FlowDocumentReader>
  <FlowDocument PagePadding="1.5in">
    <Paragraph>Padding is 1 and a half inches all around.</Paragraph>
  </FlowDocument>
</FlowDocumentReader>

<FlowDocumentReader>
  <FlowDocument PagePadding="5,10,5,10">
    <Paragraph>Padding is 5 pixels on the right and left, and 10 pixels on the top and botton.</Paragraph>
  </FlowDocument>
</FlowDocumentReader>

<FlowDocumentReader>
  <FlowDocument PagePadding="0.8in,20,0.8in,20">
    <Paragraph>Padding is 1 eigth of an inch on the right and left, and 20 pixels on the top and botton.</Paragraph>
  </FlowDocument>
</FlowDocumentReader>

次の例では、PagePadding プロパティをプログラムで設定する方法を示しています。

FlowDocument flowDoc = new FlowDocument(new Paragraph(new Run("A bit of text content...")));

// Padding is 10 pixels all around.
flowDoc.PagePadding = new Thickness(10);
// Padding is 5 pixels on the right and left, and 10 pixels on the top and botton.
flowDoc.PagePadding = new Thickness(5, 10, 5, 10);
Dim flowDoc As New FlowDocument(New Paragraph(New Run("A bit of text content...")))

' Padding is 10 pixels all around.
flowDoc.PagePadding = New Thickness(10)
' Padding is 5 pixels on the right and left, and 10 pixels on the top and botton.
flowDoc.PagePadding = New Thickness(5, 10, 5, 10)

注釈

PagePaddingは、すべての方向に均一として記述できます ()、または左、上、右、および下部のパディングを個別に表す 4 つの個別の値として記述できます (PagePadding="10"PagePadding="5,0,10,20")。

指定したパディングの太さが対応するページディメンションを超える場合 (たとえば、左右のパディング幅の合計がページ幅を超える場合)、パディングの厚さは、関連するページディメンションを超えないように比例して縮小されます。

XAML 属性の使用方法

<object PagePadding="uniformThickness"/>  
- or -  
<object PagePadding="independentThickness"/>  
- or -  
<object PagePadding="qualifiedUniformThickness"/>  
- or -  
<object PagePadding="qualifiedIndependentThickness"/>  

XAML 値

uniformThickness
4 つの厚み寸法すべてに均一に適用する 1 つの Double 値の文字列表現。 たとえば、 の "10" 値は の "10,10,10,10"値と同じです。 非修飾値は、デバイスに依存しないピクセル単位で測定されます。 文字列に明示的に小数点を含める必要はありません。

independentThickness
左、上、右、下の独立した厚み寸法に対応する 4 つの順序付けられた Double 値の文字列表現 (この順序)。 4 つの値はコンマで区切る必要があります。スペースは使用できません。 たとえば、"5,10,15,20" では、コンテンツの左側に 5 ピクセルのパディング、コンテンツの上に 10 ピクセルのパディング、コンテンツの右側に 15 ピクセルのパディング、コンテンツの下に 20 ピクセルのパディングが行われます。

qualifiedUniformThickness
uniformThickness の後に、次のいずれかの単位指定子 px(、in) で記述された値。

px (既定値) はデバイスに依存しない単位 (ユニットあたり 1/96 インチ) です

in はインチ。1in==96px

たとえば、 "1in" は、すべての方向に 1 インチの均一なパディングを提供します。

qualifiedIndependentThickness
independentThickness で記述された値。各独立した値の後に、次のいずれかの単位指定子がin続きます。 px

px (既定値) はデバイスに依存しない単位 (ユニットあたり 1/96 インチ) です

in はインチ。1in==96px

たとえば、「 "1.5in,0.8in,1.5in,0.8in" 」のように入力します。 単位指定子は、1 つ以上の値から混合または省略できます。

依存プロパティ情報

識別子フィールド PagePaddingProperty
に設定されたメタデータ プロパティ true AffectsMeasure

適用対象