共用方式為


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>

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

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 。 如果三個屬性都設在給定頁面上,則這是屬性評估的順序。

PageWidth 設定為 Double.NaN (auto) 時,這個屬性不會生效。

XAML 屬性使用方式

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

XAML 值

雙重Double

字串表示 Double 等於或大於0.0但小 Double.PositiveInfinity於的值。 未限定值以裝置獨立像素為單位。 字串不必明確包含小數點。

取得雙重資格如上所述的雙倍值,接著是以下單位指定符之一:pxincmpt, ,

px (預設)為裝置無關單位(每單位 1/96 吋)

in 是英吋;1in==96px

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

pt 是分數;1pt==(96/72) px

相依財產資訊

項目 價值
識別碼欄位 MaxPageWidthProperty
元資料屬性設為 true AffectsMeasure

適用於