FigureLength Structure
.NET Framework 4.5
Describes the height or width of a Figure.
Namespace: System.Windows
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
The FigureLength type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | FigureLength(Double) | Initializes a new instance of the FigureLength class with the specified number of pixels in length. |
![]() | FigureLength(Double, FigureUnitType) | Initializes a new instance of the FigureLength class with the specified Value and FigureUnitType. |
| Name | Description | |
|---|---|---|
![]() | FigureUnitType | Gets the unit type of the Value. |
![]() | IsAbsolute | Gets a value that determines whether this FigureLength holds an absolute value (in pixels). |
![]() | IsAuto | Gets a value that determines whether this FigureLength is automatic (not specified). |
![]() | IsColumn | Gets a value that determines whether this FigureLength has a FigureUnitType property value of Column. |
![]() | IsContent | Gets a value that determines whether this FigureLength has a FigureUnitType property value of Content. |
![]() | IsPage | Gets a value that determines whether this FigureLength has a FigureUnitType property value of Page. |
![]() | Value | Gets the value of this FigureLength. |
| Name | Description | |
|---|---|---|
![]() | Equals(FigureLength) | Compares two FigureLength structures for equality. |
![]() | Equals(Object) | Determines whether the specified Object is a FigureLength and whether it is identical to this FigureLength. (Overrides ValueType.Equals(Object).) |
![]() | GetHashCode | Returns the hash code for this FigureLength. (Overrides ValueType.GetHashCode().) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | ToString | Creates a String representation of this FigureLength. (Overrides ValueType.ToString().) |
| Name | Description | |
|---|---|---|
![]() ![]() | Equality | Compares two FigureLength structures for equality. |
![]() ![]() | Inequality | Compares 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="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); } } } }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
