FigureLength Constructores

Definición

Inicializa una nueva instancia de FigureLength.

Sobrecargas

Nombre Description
FigureLength(Double)

Inicializa una nueva instancia de la FigureLength clase con el número especificado de píxeles de longitud.

FigureLength(Double, FigureUnitType)

Inicializa una nueva instancia de la FigureLength clase con los valores especificados Value y FigureUnitType.

FigureLength(Double)

Inicializa una nueva instancia de la FigureLength clase con el número especificado de píxeles de longitud.

public:
 FigureLength(double pixels);
public FigureLength(double pixels);
new System.Windows.FigureLength : double -> System.Windows.FigureLength
Public Sub New (pixels As Double)

Parámetros

pixels
Double

Número de píxeles independientes del dispositivo (96 píxeles por pulgada) que componen la longitud.

Ejemplos

En el ejemplo siguiente, cuando el usuario hace clic en , Figuredisminuye el Width de .Figure A continuación se muestra el CÓDIGO XAML del ejemplo.

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

A continuación se muestra el código usado para reducir el Width de .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);
            }
        }
    }
}

Se aplica a

FigureLength(Double, FigureUnitType)

Inicializa una nueva instancia de la FigureLength clase con los valores especificados Value y FigureUnitType.

public:
 FigureLength(double value, System::Windows::FigureUnitType type);
public FigureLength(double value, System.Windows.FigureUnitType type);
new System.Windows.FigureLength : double * System.Windows.FigureUnitType -> System.Windows.FigureLength
Public Sub New (value As Double, type As FigureUnitType)

Parámetros

value
Double

Value de la FigureLength clase .

type
FigureUnitType

Value de la FigureUnitType clase .

Ejemplos

En el ejemplo siguiente, cuando el usuario hace clic en , Figuredisminuye el Width de .Figure A continuación se muestra el CÓDIGO XAML del ejemplo.

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

A continuación se muestra el código usado para reducir el Width de .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);
            }
        }
    }
}

Se aplica a