Block.LineHeight Propiedad
Definición
Obtiene o establece el alto de cada línea de contenido.Gets or sets the height of each line of content.
public:
property double LineHeight { double get(); void set(double value); };
[System.ComponentModel.TypeConverter(typeof(System.Windows.LengthConverter))]
public double LineHeight { get; set; }
member this.LineHeight : double with get, set
Public Property LineHeight As Double
Valor de propiedad
El alto de cada línea en píxeles independientes del dispositivo, en el intervalo de 0,0034 a 160 000, o NaN para determinar el alto automáticamente.The height of each line in device independent pixels, in the range of 0.0034 to 160000, or NaN to determine the height automatically. De manera predeterminada, es NaN.The default is NaN.
- Atributos
Excepciones
LineHeight se establece en un valor no positivo.LineHeight is set to a non-positive value.
Ejemplos
En el ejemplo siguiente se muestra cómo establecer LineHeight el atributo de Block un elemento.The following example shows how to set the LineHeight attribute of a Block element.
<FlowDocument>
<Paragraph
TextAlignment="Left"
Background="AliceBlue"
FontSize="24"
LineHeight="48"
>
One<LineBreak/>
two two<LineBreak/>
Three Three Three<LineBreak/>
four four four four<LineBreak/>
Five Five Five Five Five
</Paragraph>
</FlowDocument>
En la ilustración siguiente se muestra cómo se representa el ejemplo anterior.The following figure shows how the preceding example renders.
![Captura Captura de]pantalla de LineHeight(~/add/media/flowdocument-lineheight.png "de FlowDocument: LineHeight de FlowDocument")
En la ilustración siguiente se muestra cómo FlowDocument se representa el mismo con la configuración LineHeightpredeterminada de =. Double.NaNThe following figure shows how the same FlowDocument renders with the default setting of LineHeight=Double.NaN.
![Captura Captura de pantalla]predeterminada(~/add/media/flowdocument-lineheightdefault.png "de LineHeight de FlowDocument: Valor predeterminado de LineHeight de FlowDocument")
En el ejemplo siguiente se muestra cómo establecer LineHeight la propiedad mediante programación.The following example shows how to set the LineHeight property programmatically.
Paragraph par = new Paragraph();
par.LineHeight = 48;
Dim par As New Paragraph()
par.LineHeight = 48
Comentarios
Un valor de Double.NaN (equivalente a un valor de atributo Auto
de) indica que el alto de línea se determina automáticamente a partir de las características de la fuente actual.A value of Double.NaN (equivalent to an attribute value of Auto
) indicates that the line height is determined automatically from the current font characteristics.
Al cambiar este valor, no se cambia el alto del texto asociado; en su lugar, cambia el alto de la línea que contiene el texto.Changing this value does not change the height of the associated text; rather, it changes the height of the line that contains the text. Para cambiar el tamaño del texto, use la FontSize propiedad.To change the size of the text, use the FontSize property.
Además de esta propiedad, el diseño de las líneas de un Block se ve afectado por LineStackingStrategy su propiedad.In addition to this property, the layout of lines in a Block is affected by its LineStackingStrategy property.
Uso de atributos XAMLXAML Attribute Usage
<object LineHeight="double"/>
- or -
<object LineHeight="qualifiedDouble"/>
- or -
<object LineHeight="Auto"/>
Valores XAMLXAML Values
doubledouble
Double
Representación de cadena de Double un valor igual o mayor que 0,0034 pero igual o menor que 160000.String representation of a Double value equal to or greater than 0.0034 but equal to or less than 160000. Un valor no calificado se mide en píxeles independientes del dispositivo.An unqualified value is measured in device independent pixels. Las cadenas no deben incluir explícitamente los puntos decimales.Strings need not explicitly include decimal points.
qualifiedDoublequalifiedDouble
Un valor Double tal y como se ha descrito anteriormente Auto
, (excepto) seguido de uno de los siguientes especificadores in
de cm
unidad pt
: px
,,,.A double value as described above, (excepting Auto
) followed by one of the following unit specifiers: px
, in
, cm
, pt
.
px
(valor predeterminado) esunidades independientes de dispositivo (1/96 de pulgada por unidad)device-independent units (1/96th inch per unit)px
(default) is unidades independientes de dispositivo (1/96 de pulgada por unidad)device-independent units (1/96th inch per unit)
in
es pulgadas; 1in = =, 96 PXin
is inches; 1in==96px
cm
es centímetros; 1cm = = (96/2,54) PXcm
is centimeters; 1cm==(96/2.54) px
pt
es un punto; 1PT. = = (96/72) PXpt
is points; 1pt==(96/72) px
AutomáticoAuto
Hace que el alto de línea se determine automáticamente a partir de las características de la fuente actual.Causes the line height is determined automatically from the current font characteristics. Equivalente a un valor de propiedad Double.NaNde.Equivalent to a property value of Double.NaN.
Información sobre propiedades de dependenciaDependency Property Information
Campo de identificadorIdentifier field | LineHeightProperty |
Propiedades de metadatos establecidas entrue Metadata properties set to true |
AffectsMeasure, AffectsRender, InheritsAffectsMeasure, AffectsRender, Inherits |