FigureLength Structure

 

Describes the height or width of a Figure.

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

[TypeConverterAttribute(typeof(FigureLengthConverter))]
public struct FigureLength : IEquatable<FigureLength>

NameDescription
System_CAPS_pubmethodFigureLength(Double)

Initializes a new instance of the FigureLength class with the specified number of pixels in length.

System_CAPS_pubmethodFigureLength(Double, FigureUnitType)

Initializes a new instance of the FigureLength class with the specified Value and FigureUnitType.

NameDescription
System_CAPS_pubpropertyFigureUnitType

Gets the unit type of the Value.

System_CAPS_pubpropertyIsAbsolute

Gets a value that determines whether this FigureLength holds an absolute value (in pixels).

System_CAPS_pubpropertyIsAuto

Gets a value that determines whether this FigureLength is automatic (not specified).

System_CAPS_pubpropertyIsColumn

Gets a value that determines whether this FigureLength has a FigureUnitType property value of Column.

System_CAPS_pubpropertyIsContent

Gets a value that determines whether this FigureLength has a FigureUnitType property value of Content.

System_CAPS_pubpropertyIsPage

Gets a value that determines whether this FigureLength has a FigureUnitType property value of Page.

System_CAPS_pubpropertyValue

Gets the value of this FigureLength.

NameDescription
System_CAPS_pubmethodEquals(FigureLength)

Compares two FigureLength structures for equality.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified Object is a FigureLength and whether it is identical to this FigureLength.(Overrides ValueType.Equals(Object).)

System_CAPS_pubmethodGetHashCode()

Returns the hash code for this FigureLength.(Overrides ValueType.GetHashCode().)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Creates a String representation of this FigureLength.(Overrides ValueType.ToString().)

NameDescription
System_CAPS_puboperatorSystem_CAPS_staticEquality(FigureLength, FigureLength)

Compares two FigureLength structures for equality.

System_CAPS_puboperatorSystem_CAPS_staticInequality(FigureLength, FigureLength)

Compares two FigureLength structures for inequality.

<object property="length"/>
- or -
<object property="qualifiedDouble"/>

length

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.

qualifiedDouble

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

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="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>

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
Available since 3.0

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

Return to top
Show: