語言

FigureUnitType 列舉

定義

描述與 FigureLength寬度或高度相關聯的單位類型。

public enum class FigureUnitType
public enum FigureUnitType
type FigureUnitType = 
Public Enum FigureUnitType
繼承
FigureUnitType

欄位

名稱 值 Description
Auto 0

預設值當未指定時 FigureLength ,會產生一個寬度或高度 Figure 的值,該值計算時沒有限制。 註: 當 FigureUnitType 設為 Auto時, Value 的 FigureLength 性質 設為 1。

Pixel 1

寬 Figure 度或高度的值以像素數表示(每英吋96像素)。

Column 2

該 Figure 欄位寬度或高度的值以所屬欄位 Figure 寬度的分數(包含大於1的分數)表示。

Content 3

寬 Figure 度或高度的值以內容寬度 Figure的分數(包含大於1的分數)表示。 注意: 注意: 當 FigureUnitType 設定為 Content時, Value 的 FigureLength 性質必須設定為介於 0 與 1之間的值。

Page 4

寬 Figure 度或高度的值以所屬頁面寬度 Figure 的分數(包含大於1的分數)表示。 注意: 注意: 當 FigureUnitType 設定為 Page時, Value 的 FigureLength 性質必須設定為介於 0 與 1之間的值。

範例

以下範例中,當使用者點擊 Figure時,的 Width 會Figure減少。 以下是該範例的 XAML 版本。

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  x:Class="SDKSample.FigureLengthExample" >

  <FlowDocumentReader>
    <FlowDocument >
      <Paragraph>
        Raw text inside the paragraph
        <Figure Name="myFigure" Width="300">
          <Paragraph FontStyle="Italic" MouseDown="OnMouseDownDecreaseWidth" >
            Text inside of paragraph that is inside Figure...
          </Paragraph>
        </Figure>
      </Paragraph>
    </FlowDocument>
  </FlowDocumentReader>



</Page>

以下是用來降低 Pixel 來指定單位類型的程式碼WidthFigure。

using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

namespace SDKSample
{
    public partial class FigureLengthExample : Page
    {

        void OnMouseDownDecreaseWidth(object sender, MouseButtonEventArgs args)
        {
            FigureLength myFigureLength = myFigure.Width;
            double widthValue = myFigureLength.Value;
            if (widthValue > 0)
            {
                myFigure.Width = new FigureLength((widthValue - 10), FigureUnitType.Pixel);
            }
        }
    }
}

適用於