FigureLength Construtores
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Inicializa uma nova instância do FigureLength.
Sobrecargas
| Name | Description |
|---|---|
| FigureLength(Double) |
Inicializa uma nova instância da FigureLength classe com o número especificado de pixels de comprimento. |
| FigureLength(Double, FigureUnitType) |
Inicializa uma nova instância da FigureLength classe com os especificados Value e FigureUnitType. |
FigureLength(Double)
Inicializa uma nova instância da FigureLength classe com o número especificado de pixels de comprimento.
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 píxeis independentes do dispositivo (96 píxeis por polegada) que compõem o comprimento.
Exemplos
No exemplo seguinte, quando o utilizador clica no Figure, o Width de diminui Figure . Abaixo está o XAML da amostra.
<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 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);
}
}
}
}
Aplica-se a
FigureLength(Double, FigureUnitType)
Inicializa uma nova instância da FigureLength classe com os especificados Value e 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
A Value da FigureLength turma.
- type
- FigureUnitType
A Value da FigureUnitType turma.
Exemplos
No exemplo seguinte, quando o utilizador clica no Figure, o Width de diminui Figure . Abaixo está o XAML da amostra.
<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 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);
}
}
}
}