FlowDocument.MaxPageWidth 屬性

定義

取得或設定 FlowDocument 中頁面的最大寬度。

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

屬性值

FlowDocument 中頁面的最大寬度 (以與裝置無關的像素為單位)。 預設值為 PositiveInfinity (沒有最大頁面寬度)。

屬性

範例

下列範例示範如何設定 MaxPageWidth 專案的 屬性 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>

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

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

備註

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

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

XAML Attribute Usage

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

XAML 值

double
Double

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

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

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

in 為英吋;1in==96px

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

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

相依性屬性資訊

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

適用於