FigureLength 構造体

定義

Figureの高さまたは幅について説明します。

public value class FigureLength : IEquatable<System::Windows::FigureLength>
[System.ComponentModel.TypeConverter(typeof(System.Windows.FigureLengthConverter))]
public struct FigureLength : IEquatable<System.Windows.FigureLength>
[<System.ComponentModel.TypeConverter(typeof(System.Windows.FigureLengthConverter))>]
type FigureLength = struct
Public Structure FigureLength
Implements IEquatable(Of FigureLength)
継承
FigureLength
属性
実装

次の例では、ユーザーがFigureをクリックすると、WidthFigureが減少します。 サンプルの 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>

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);
            }
        }
    }
}

注釈

XAML 属性の使用法

<object property="length"/>

-又は-

<object property="qualifiedDouble"/>

XAML 値

長さFigureの幅または高さをピクセル単位で指定し、Double値として記述します。 または、この値は、以下のpx を参照して、単位宣言文字列 (incmpt) で修飾することもできます。

qualifiedDouble 上で説明した double 値の後に、 pxincmptのいずれかの単位宣言文字列が続きます。

px (既定値) はデバイスに依存しない単位 (ユニットあたり 1/96 インチ) です

in はインチです。1in==96px

cm はセンチメートルです。1cm==(96/2.54) px

pt はポイントです。1pt==(96/72) px

コンストラクター

名前 説明
FigureLength(Double, FigureUnitType)

指定したFigureLengthValueを使用して、FigureUnitType クラスの新しいインスタンスを初期化します。

FigureLength(Double)

指定したピクセル数の長さで、 FigureLength クラスの新しいインスタンスを初期化します。

プロパティ

名前 説明
FigureUnitType

Valueの単位の種類を取得します。

IsAbsolute

この FigureLength が絶対値 (ピクセル単位) を保持するかどうかを決定する値を取得します。

IsAuto

この FigureLength が自動 (指定されていない) かどうかを決定する値を取得します。

IsColumn

このFigureLengthFigureUnitTypeColumn プロパティ値があるかどうかを決定する値を取得します。

IsContent

このFigureLengthFigureUnitTypeContent プロパティ値があるかどうかを決定する値を取得します。

IsPage

このFigureLengthFigureUnitTypePage プロパティ値があるかどうかを決定する値を取得します。

Value

この FigureLengthの値を取得します。

メソッド

名前 説明
Equals(FigureLength)

2 つの FigureLength 構造体の等価性を比較します。

Equals(Object)

指定した ObjectFigureLength であるかどうかを判断し、この FigureLengthと同じかどうかを判断します。

GetHashCode()

この FigureLengthのハッシュ コードを返します。

ToString()

このStringFigureLength表現を作成します。

演算子

名前 説明
Equality(FigureLength, FigureLength)

2 つの FigureLength 構造体の等価性を比較します。

Inequality(FigureLength, FigureLength)

2 つの FigureLength 構造体の不等値を比較します。

適用対象