FigureUnitType 列挙型
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
FigureLengthの幅または高さに関連付けられた単位の種類について説明します。
public enum class FigureUnitType
public enum FigureUnitType
type FigureUnitType =
Public Enum FigureUnitType
- 継承
フィールド
| 名前 | 値 | 説明 |
|---|---|---|
| Auto | 0 | 制約なしで計算されるFigureLengthの幅または高さの値を作成するFigureが指定されていない場合の既定値。
メモ:FigureUnitTypeを Auto に設定すると、Valueの FigureLength プロパティは |
| Pixel | 1 | Figureの幅または高さの値は、ピクセル (96 ピクセル/インチ) で表されます。 |
| Column | 2 | |
| Content | 3 |
Figureの幅または高さの値は、Figureのコンテンツ幅の分数 (1 より大きい分数を含む) として表されます。 注:FigureUnitTypeがContentに設定されている場合、ValueのFigureLengthプロパティは、 |
| Page | 4 |
Figureの幅または高さの値は、Figureのページ幅の分数 (1 より大きい分数を含む) として表されます。 注:FigureUnitTypeがPageに設定されている場合、ValueのFigureLengthプロパティは、 |
例
次の例では、ユーザーが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>
ピクセルを使用して単位の種類を指定して、WidthのFigureを減らすコードを次に示します。
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);
}
}
}
}