FigureUnitType Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Describes the unit type associated with the width or height of a FigureLength.
public enum class FigureUnitType
public enum FigureUnitType
type FigureUnitType =
Public Enum FigureUnitType
- Inheritance
Fields
Auto | 0 | Default value when the FigureLength is not specified which creates a value for the width or height of the Figure that is calculated without constraints. Note: When FigureUnitType is set to Auto, the Value property of FigureLength is set to |
Column | 2 | The value of the width or height of the Figure is expressed as a fraction (including fractions greater then 1) of the width of the column the Figure is in. |
Content | 3 | The value of the width or height of the Figure is expressed as a fraction (including fractions greater then 1) of the content width of the Figure. Note: Note: When FigureUnitType is set to Content, the Value property of FigureLength must be set to a value between |
Page | 4 | The value of the width or height of the Figure is expressed as a fraction (including fractions greater then 1) of the page width of that the Figure is in. Note: Note: When FigureUnitType is set to Page, the Value property of FigureLength must be set to a value between |
Pixel | 1 | The value of the width or height of the Figure is expressed in pixels (96 pixels-per-inch). |
Examples
In the following example, when the user clicks on the Figure, the Width of the Figure decreases. Below is the XAML for the sample.
<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>
Below is the code used to decrease the Width of the Figure using the Pixel to specify the unit type.
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);
}
}
}
}
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기