Class Block
An abstract class that provides a base for all block-level content elements.
Inherited Members
Namespace: System.Windows.Documents
Assembly: OpenSilver.dll
Syntax
public abstract class Block : TextElement, IUIElement, IDependencyObject
Constructors
| Improve this Doc View SourceBlock()
Initializes a new instance of the Block class.
Declaration
protected Block()
Fields
| Improve this Doc View SourceLineHeightProperty
Identifies the LineHeight dependency property.
Declaration
public static readonly DependencyProperty LineHeightProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
LineStackingStrategyProperty
Identifies the LineStackingStrategy dependency property.
Declaration
public static readonly DependencyProperty LineStackingStrategyProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
TextAlignmentProperty
Identifies the TextAlignment dependency property.
Declaration
public static readonly DependencyProperty TextAlignmentProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceLineHeight
Gets or sets the height of each line of content.
Declaration
public double LineHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The height of each line in pixels. A value of 0 indicates that the line height is determined automatically from the current font characteristics. The default is 0. |
LineStackingStrategy
Gets or sets a value that indicates how a line box is determined for each line of text in a Block. The default is MaxHeight.
Declaration
public LineStackingStrategy LineStackingStrategy { get; set; }
Property Value
Type | Description |
---|---|
LineStackingStrategy |
TextAlignment
Gets or sets the horizontal alignment of the text content. The default is Left.
Declaration
public TextAlignment TextAlignment { get; set; }
Property Value
Type | Description |
---|---|
TextAlignment |
Methods
| Improve this Doc View SourceGetLineHeight(DependencyObject)
Returns the value of the LineHeight attached property for a specified dependency object.
Declaration
public static double GetLineHeight(DependencyObject element)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | element | The dependency object from which to retrieve the value of the LineHeight property. |
Returns
Type | Description |
---|---|
System.Double | The current value of the LineHeight attached property on the specified dependency object. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | element is null. |
GetLineStackingStrategy(DependencyObject)
Returns the value of the LineStackingStrategy attached property for a specified dependency object.
Declaration
public static LineStackingStrategy GetLineStackingStrategy(DependencyObject element)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | element | The dependency object from which to retrieve the value of the LineStackingStrategy attached property. |
Returns
Type | Description |
---|---|
LineStackingStrategy | The current value of the LineStackingStrategy attached property on the specified dependency object. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | element is null. |
GetTextAlignment(DependencyObject)
Returns the value of the TextAlignment attached property for a specified dependency object.
Declaration
public static TextAlignment GetTextAlignment(DependencyObject element)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | element | The dependency object from which to retrieve the value of the TextAlignment property. |
Returns
Type | Description |
---|---|
TextAlignment | The current value of the TextAlignment attached property on the specified dependency object. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | element is null. |
SetLineHeight(DependencyObject, Double)
Sets the value of the LineHeight attached property for a specified dependency object.
Declaration
public static void SetLineHeight(DependencyObject element, double value)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | element | The dependency object on which to set the value of the LineHeight property. |
System.Double | value | The new value to set the property to. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | element is null. |
System.ArgumentException | value is negative. |
SetLineStackingStrategy(DependencyObject, LineStackingStrategy)
Sets the value of the LineStackingStrategy attached property on a specified dependency object.
Declaration
public static void SetLineStackingStrategy(DependencyObject element, LineStackingStrategy value)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | element | The dependency object on which to set the value of the LineStackingStrategy property. |
LineStackingStrategy | value | The new value to set the property to. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | element is null. |
SetTextAlignment(DependencyObject, TextAlignment)
Sets the value of the TextAlignment attached property for a specified dependency object.
Declaration
public static void SetTextAlignment(DependencyObject element, TextAlignment value)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | element | The dependency object on which to set the value of the TextAlignment property. |
TextAlignment | value | The new value to set the property to. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | element is null. |