FlowDocument.MinPageHeight 屬性

定義

取得或設定 FlowDocument 中頁面的最小高度。

public:
 property double MinPageHeight { double get(); void set(double value); };
[System.ComponentModel.TypeConverter(typeof(System.Windows.LengthConverter))]
public double MinPageHeight { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Windows.LengthConverter))>]
member this.MinPageHeight : double with get, set
Public Property MinPageHeight As Double

屬性值

FlowDocument 中頁面的最小高度 (以與裝置無關的像素為單位)。 預設值為 0.0。

屬性

範例

下列範例示範如何設定 MinPageHeight 專案的 屬性 FlowDocument

<FlowDocumentReader>
  <FlowDocument
    PageHeight="Auto"
    PageWidth="Auto"
    MinPageHeight="3in"
    MinPageWidth="5in"
    MaxPageHeight="6in"
    MaxPageWidth="10in"
  >
    <Paragraph Background="BlanchedAlmond">
      This uses automatic page sizing with minimum page size of 3 by 5 inches,
      and a maximum page size of 6 by 10 inches.
    </Paragraph>
  </FlowDocument>
</FlowDocumentReader>

下列範例示範如何以程式設計方式設定 MinPageHeight 屬性。

FlowDocument flowDoc = new FlowDocument(new Paragraph(new Run("A bit of text content...")));
// Set PageHeight and PageWidth to "Auto".
flowDoc.PageHeight = Double.NaN;
flowDoc.PageWidth = Double.NaN;
// Specify minimum page sizes.
flowDoc.MinPageWidth = 680.0;
flowDoc.MinPageHeight = 480.0;
//Specify maximum page sizes.
flowDoc.MaxPageWidth = 1024.0;
flowDoc.MaxPageHeight = 768.0;
Dim flowDoc As New FlowDocument(New Paragraph(New Run("A bit of text content...")))
' Set PageHeight and PageWidth to "Auto".
flowDoc.PageHeight = Double.NaN
flowDoc.PageWidth = Double.NaN
' Specify minimum page sizes.
flowDoc.MinPageWidth = 680.0
flowDoc.MinPageHeight = 480.0
'Specify maximum page sizes.
flowDoc.MaxPageWidth = 1024.0
flowDoc.MaxPageHeight = 768.0

備註

如果在持續性上檢視,則 MinPageHeight 屬性會優先于 MaxPageHeight 屬性,而該屬性又優先于 PageHeight 屬性。 如果指定頁面上設定了這三個屬性,則這是評估屬性的順序。

當 設定為 Double.NaN (自動) 時 PageHeight ,這個屬性不會有任何作用。

XAML Attribute Usage

<object MinPageHeight="double"/>  
- or -  
<object MinPageHeight="qualifiedDouble"/>  

XAML 值

double
Double

值等於或大於 0.0 但小於 Double.PositiveInfinityDouble 字串表示。 不合格的值是以裝置獨立圖元來測量。 字串不需要明確包含小數點。

qualifiedDouble
如上所述的 雙精度 浮點數,後面接著下列其中一個單位規範: px 、、 incmpt

px (預設) 是裝置獨立單位 (,每個單位 1/96 英吋)

in 為英吋;1in==96px

cm 為公分;1cm== (96/2.54) px

pt 為點;1pt== (96/72) px

相依性屬性資訊

識別碼欄位 MinPageHeightProperty
設定為 的中繼資料屬性 true AffectsMeasure

適用於