FigureLength Konstruktory

Definicja

Inicjuje nowe wystąpienie klasy FigureLength.

Przeciążenia

FigureLength(Double)

Inicjuje FigureLength nowe wystąpienie klasy o określonej liczbie pikseli długości.

FigureLength(Double, FigureUnitType)

Inicjuje FigureLength nowe wystąpienie klasy o określonej wartości Value i FigureUnitType.

FigureLength(Double)

Inicjuje FigureLength nowe wystąpienie klasy o określonej liczbie pikseli długości.

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

Parametry

pixels
Double

Liczba pikseli niezależnych od urządzenia (96 pikseli na cal), które składają się na długość.

Przykłady

W poniższym przykładzie, gdy użytkownik kliknie wartość Figure, WidthFigure zmniejszy się. Poniżej znajduje się kod XAML dla przykładu.

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

Poniżej znajduje się kod używany do zmniejszenia Width wartości 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);
            }
        }
    }
}

Dotyczy

FigureLength(Double, FigureUnitType)

Inicjuje FigureLength nowe wystąpienie klasy o określonej wartości Value i 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)

Parametry

value
Double

FigureLength Klasa Value .

Przykłady

W poniższym przykładzie, gdy użytkownik kliknie wartość Figure, WidthFigure zmniejszy się. Poniżej znajduje się kod XAML dla przykładu.

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

Poniżej znajduje się kod używany do zmniejszenia Width wartości 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);
            }
        }
    }
}

Dotyczy