FigureLength Constructors
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Initialiseert een nieuw exemplaar van de FigureLength.
Overloads
| Name | Description |
|---|---|
| FigureLength(Double) |
Initialiseert een nieuw exemplaar van de FigureLength klasse met het opgegeven aantal pixels in lengte. |
| FigureLength(Double, FigureUnitType) |
Initialiseert een nieuw exemplaar van de FigureLength klasse met de opgegeven Value en FigureUnitType. |
FigureLength(Double)
Initialiseert een nieuw exemplaar van de FigureLength klasse met het opgegeven aantal pixels in lengte.
public:
FigureLength(double pixels);
public FigureLength(double pixels);
new System.Windows.FigureLength : double -> System.Windows.FigureLength
Public Sub New (pixels As Double)
Parameters
- pixels
- Double
Het aantal apparaatonafhankelijke pixels (96 pixels per inch) waaruit de lengte bestaat.
Voorbeelden
Wanneer de gebruiker in het volgende voorbeeld op de Figureknop klikt, neemt de WidthFigure afname af. Hieronder ziet u de XAML voor het voorbeeld.
<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>
Hieronder ziet u de code die wordt gebruikt om de 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);
}
}
}
}
Van toepassing op
FigureLength(Double, FigureUnitType)
Initialiseert een nieuw exemplaar van de FigureLength klasse met de opgegeven Value en 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)
Parameters
- value
- Double
Value De FigureLength klas.
- type
- FigureUnitType
Value De FigureUnitType klas.
Voorbeelden
Wanneer de gebruiker in het volgende voorbeeld op de Figureknop klikt, neemt de WidthFigure afname af. Hieronder ziet u de XAML voor het voorbeeld.
<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>
Hieronder ziet u de code die wordt gebruikt om de 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);
}
}
}
}