This documentation is archived and is not being maintained.

FigureLength Structure

Describes the height or width of a Figure.

Namespace:  System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)

public struct FigureLength : IEquatable<FigureLength>
<object property="length"/>
- or -
<object property="qualifiedDouble"/>

XAML Values


The width or height of the Figure in pixels, described as a Double value. Alternatively, this value can be qualified with a unit declaration string (px, in, cm, pt) see qualifiedDouble below.


A double value as described above followed by one of the following unit declaration strings: px, in, cm, pt.

px (default) is device-independent units (1/96th inch per unit)

in is inches; 1in==96px

cm is centimeters; 1cm==(96/2.54) px

pt is points; 1pt==(96/72) px

The FigureLength type exposes the following members.

Public methodFigureLength(Double)Initializes a new instance of the FigureLength class with the specified number of pixels in length.
Public methodFigureLength(Double, FigureUnitType)Initializes a new instance of the FigureLength class with the specified Value and FigureUnitType.

Public propertyFigureUnitTypeGets the unit type of the Value.
Public propertyIsAbsoluteGets a value that determines whether this FigureLength holds an absolute value (in pixels).
Public propertyIsAutoGets a value that determines whether this FigureLength is automatic (not specified).
Public propertyIsColumnGets a value that determines whether this FigureLength has a FigureUnitType property value of Column.
Public propertyIsContentGets a value that determines whether this FigureLength has a FigureUnitType property value of Content.
Public propertyIsPageGets a value that determines whether this FigureLength has a FigureUnitType property value of Page.
Public propertyValueGets the value of this FigureLength.

Public methodEquals(FigureLength)Compares two FigureLength structures for equality.
Public methodEquals(Object)Determines whether the specified Object is a FigureLength and whether it is identical to this FigureLength. (Overrides ValueType.Equals(Object).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeReturns the hash code for this FigureLength. (Overrides ValueType.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringCreates a String representation of this FigureLength. (Overrides ValueType.ToString().)

Public operatorStatic memberEqualityCompares two FigureLength structures for equality.
Public operatorStatic memberInequalityCompares two FigureLength structures for inequality.

In the following example, when the user clicks on the Figure, the Width of the Figure decreases. Below is the XAML for the sample.

<Page xmlns=""
  x:Class="SDKSample.FigureLengthExample" >

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


Below is the code used to decrease the Width of the 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);

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.