FigureLength Construtores

Definição

Inicializa uma nova instância do FigureLength.

Sobrecargas

FigureLength(Double)

Inicializa uma nova instância da classe FigureLength com o número especificado pixels no tamanho.

FigureLength(Double, FigureUnitType)

Inicializa uma nova instância da classe FigureLength com o Value e FigureUnitType especificados.

FigureLength(Double)

Inicializa uma nova instância da classe FigureLength com o número especificado pixels no tamanho.

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

O número de pixels independentes de dispositivo (96 pixels por polegada) que compõem o tamanho.

Exemplos

No exemplo a seguir, quando o usuário clica no Figure, o Width Figure valor diminui. Abaixo está o XAML para o exemplo.

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

Abaixo está o código usado para diminuir o Width 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);
            }
        }
    }
}

Aplica-se a

FigureLength(Double, FigureUnitType)

Inicializa uma nova instância da classe FigureLength com o Value e FigureUnitType especificados.

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

O Value da classe FigureLength.

type
FigureUnitType

O Value da classe FigureUnitType.

Exemplos

No exemplo a seguir, quando o usuário clica no Figure, o Width Figure valor diminui. Abaixo está o XAML para o exemplo.

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

Abaixo está o código usado para diminuir o Width 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);
            }
        }
    }
}

Aplica-se a