FigureLength Oluşturucular

Tanım

öğesinin yeni bir örneğini FigureLengthbaşlatır.

Aşırı Yüklemeler

Name Description
FigureLength(Double)

Belirtilen sayıda piksel uzunluğunda sınıfın yeni bir örneğini FigureLength başlatır.

FigureLength(Double, FigureUnitType)

Belirtilen FigureLength ve Valueile FigureUnitType sınıfının yeni bir örneğini başlatır.

FigureLength(Double)

Belirtilen sayıda piksel uzunluğunda sınıfın yeni bir örneğini FigureLength başlatır.

public:
 FigureLength(double pixels);
public FigureLength(double pixels);
new System.Windows.FigureLength : double -> System.Windows.FigureLength
Public Sub New (pixels As Double)

Parametreler

pixels
Double

Uzunluğu oluşturan cihazdan bağımsız piksel sayısı (inç başına 96 piksel).

Örnekler

Aşağıdaki örnekte, kullanıcı öğesine tıkladığındaFigureWidth, değerinin azaldığını Figure gösterir. Aşağıda, örneğin XAML'i verilmiştir.

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

Aşağıda, öğesinin sayısını azaltmak Width için kullanılan kod yer alır 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);
            }
        }
    }
}

Şunlara uygulanır

FigureLength(Double, FigureUnitType)

Belirtilen FigureLength ve Valueile FigureUnitType sınıfının yeni bir örneğini başlatır.

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)

Parametreler

value
Double

SınıfınValue.FigureLength

Örnekler

Aşağıdaki örnekte, kullanıcı öğesine tıkladığındaFigureWidth, değerinin azaldığını Figure gösterir. Aşağıda, örneğin XAML'i verilmiştir.

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

Aşağıda, öğesinin sayısını azaltmak Width için kullanılan kod yer alır 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);
            }
        }
    }
}

Şunlara uygulanır