This documentation is archived and is not being maintained.
FigureLength Structure
Visual Studio 2008
Describes the height or width of a Figure.
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
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 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: