FigureLength コンストラクター
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
FigureLengthの新しいインスタンスを初期化します。
オーバーロード
| 名前 | 説明 |
|---|---|
| FigureLength(Double) |
指定したピクセル数の長さで、 FigureLength クラスの新しいインスタンスを初期化します。 |
| FigureLength(Double, FigureUnitType) |
指定したFigureLengthとValueを使用して、FigureUnitType クラスの新しいインスタンスを初期化します。 |
FigureLength(Double)
指定したピクセル数の長さで、 FigureLength クラスの新しいインスタンスを初期化します。
public:
FigureLength(double pixels);
public FigureLength(double pixels);
new System.Windows.FigureLength : double -> System.Windows.FigureLength
Public Sub New (pixels As Double)
パラメーター
- pixels
- Double
長さを構成するデバイスに依存しないピクセル (1 インチあたり 96 ピクセル) の数。
例
次の例では、ユーザーがFigureをクリックすると、WidthのFigureが減少します。 サンプルの XAML を次に示します。
<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>
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);
}
}
}
}
適用対象
FigureLength(Double, FigureUnitType)
指定したFigureLengthとValueを使用して、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)
パラメーター
- value
- Double
Value クラスのFigureLength。
- type
- FigureUnitType
Value クラスのFigureUnitType。
例
次の例では、ユーザーがFigureをクリックすると、WidthのFigureが減少します。 サンプルの XAML を次に示します。
<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>
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);
}
}
}
}