FigureLength Construtores
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Inicializa uma nova instância do FigureLength.
Sobrecargas
| Nome | 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 o especificado 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 pixels independentes do dispositivo (96 pixels por polegada) que compõem o comprimento.
Exemplos
No exemplo a seguir, quando o usuário clica no Figure.WidthFigure 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 WidthFigure.
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 o especificado 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
O Value da FigureLength classe.
- type
- FigureUnitType
O Value da FigureUnitType classe.
Exemplos
No exemplo a seguir, quando o usuário clica no Figure.WidthFigure 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 WidthFigure.
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);
}
}
}
}