Show / Hide Table of Contents

Class Block

An abstract class that provides a base for all block-level content elements.

Inheritance
System.Object
DependencyObject
UIElement
TextElement
Block
Paragraph
Section
Inherited Members
TextElement.CharacterSpacingProperty
TextElement.CharacterSpacing
TextElement.GetCharacterSpacing(DependencyObject)
TextElement.SetCharacterSpacing(DependencyObject, Int32)
TextElement.FontFamilyProperty
TextElement.FontFamily
TextElement.GetFontFamily(DependencyObject)
TextElement.SetFontFamily(DependencyObject, FontFamily)
TextElement.FontSizeProperty
TextElement.FontSize
TextElement.GetFontSize(DependencyObject)
TextElement.SetFontSize(DependencyObject, Double)
TextElement.FontStretchProperty
TextElement.FontStretch
TextElement.GetFontStretch(DependencyObject)
TextElement.SetFontStretch(DependencyObject, FontStretch)
TextElement.FontStyleProperty
TextElement.FontStyle
TextElement.GetFontStyle(DependencyObject)
TextElement.SetFontStyle(DependencyObject, FontStyle)
TextElement.FontWeightProperty
TextElement.FontWeight
TextElement.GetFontWeight(DependencyObject)
TextElement.SetFontWeight(DependencyObject, FontWeight)
TextElement.ForegroundProperty
TextElement.Foreground
TextElement.GetForeground(DependencyObject)
TextElement.SetForeground(DependencyObject, Brush)
TextElement.LanguageProperty
TextElement.Language
TextElement.Name
TextElement.FindName(String)
TextElement.ContentEnd
TextElement.ContentStart
TextElement.ElementEnd
TextElement.ElementStart
TextElement.OnPropertyChanged(DependencyPropertyChangedEventArgs)
TextElement.OnVisualParentChanged(DependencyObject)
TextElement.CreateDomElement(Object, Object)
UIElement.TransformToVisual(UIElement)
UIElement.OnCreateAutomationPeer()
UIElement.RenderSize
UIElement.DesiredSize
UIElement.InvalidateMeasure()
UIElement.InvalidateArrange()
UIElement.Measure(Size)
UIElement.Arrange(Rect)
UIElement.UpdateLayout()
UIElement.DragEnter
UIElement.DragLeave
UIElement.Drop
UIElement.DragOver
UIElement.CacheMode
UIElement.CacheModeProperty
UIElement.Projection
UIElement.ProjectionProperty
UIElement.VisualParent
UIElement.GetVisualChild(Int32)
UIElement.VisualChildrenCount
UIElement.AddVisualChild(UIElement)
UIElement.RemoveVisualChild(UIElement)
UIElement.OnVisualChildrenChanged(DependencyObject, DependencyObject)
UIElement.XamlSourcePath
UIElement.ClipToBounds
UIElement.ClipToBoundsProperty
UIElement.ClipProperty
UIElement.Clip
UIElement.IsEnabledProperty
UIElement.IsEnabled
UIElement.IsEnabledChanged
UIElement.ManageIsEnabled(Boolean)
UIElement.EffectProperty
UIElement.Effect
UIElement.RenderTransformProperty
UIElement.RenderTransform
UIElement.RenderTransformOriginProperty
UIElement.RenderTransformOrigin
UIElement.UseLayoutRounding
UIElement.UseLayoutRoundingProperty
UIElement.Visibility
UIElement.VisibilityProperty
UIElement.IsVisibleProperty
UIElement.IsVisible
UIElement.IsVisibleChanged
UIElement.OpacityProperty
UIElement.Opacity
UIElement.OpacityMaskProperty
UIElement.OpacityMask
UIElement.IsHitTestVisible
UIElement.IsHitTestVisibleProperty
UIElement.AllowDrop
UIElement.AllowDropProperty
UIElement.CaptureMouse()
UIElement.IsMouseCaptured
UIElement.ReleaseMouseCapture()
UIElement.AllowScrollOnTouchMove
UIElement.AllowScrollOnTouchMoveProperty
UIElement.AddHandler(RoutedEvent, Delegate, Boolean)
UIElement.RemoveHandler(RoutedEvent, Delegate)
UIElement.MouseMoveEvent
UIElement.MouseMove
UIElement.OnMouseMove(MouseEventArgs)
UIElement.MouseLeftButtonDownEvent
UIElement.MouseLeftButtonDown
UIElement.OnMouseLeftButtonDown(MouseButtonEventArgs)
UIElement.MouseRightButtonDownEvent
UIElement.MouseRightButtonDown
UIElement.OnMouseRightButtonDown(MouseButtonEventArgs)
UIElement.MouseWheelEvent
UIElement.MouseWheel
UIElement.OnMouseWheel(MouseWheelEventArgs)
UIElement.MouseLeftButtonUpEvent
UIElement.MouseLeftButtonUp
UIElement.OnMouseLeftButtonUp(MouseButtonEventArgs)
UIElement.MouseEnterEvent
UIElement.MouseEnter
UIElement.OnMouseEnter(MouseEventArgs)
UIElement.MouseLeaveEvent
UIElement.MouseLeave
UIElement.OnMouseLeave(MouseEventArgs)
UIElement.TextInputStartEvent
UIElement.TextInputStart
UIElement.OnTextInputStart(TextCompositionEventArgs)
UIElement.TextInputEvent
UIElement.TextInput
UIElement.OnTextInput(TextCompositionEventArgs)
UIElement.TextInputUpdateEvent
UIElement.TextInputUpdate
UIElement.TappedEvent
UIElement.Tapped
UIElement.OnTapped(TappedRoutedEventArgs)
UIElement.MouseRightButtonUpEvent
UIElement.MouseRightButtonUp
UIElement.OnMouseRightButtonUp(MouseButtonEventArgs)
UIElement.KeyDownEvent
UIElement.KeyDown
UIElement.OnKeyDown(KeyEventArgs)
UIElement.KeyUpEvent
UIElement.KeyUp
UIElement.OnKeyUp(KeyEventArgs)
UIElement.GotFocusEvent
UIElement.GotFocus
UIElement.OnGotFocus(RoutedEventArgs)
UIElement.LostFocusEvent
UIElement.LostFocus
UIElement.OnLostFocus(RoutedEventArgs)
UIElement.LostMouseCapture
UIElement.OnLostMouseCapture(MouseEventArgs)
UIElement.INTERNAL_AttachToDomEvents()
UIElement.INTERNAL_DetachFromDomEvents()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.INTERNAL_OnAttachedToVisualTree()
DependencyObject.INTERNAL_OnDetachedFromVisualTree()
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Documents
Assembly: OpenSilver.dll
Syntax
public abstract class Block : TextElement, IUIElement, IDependencyObject

Constructors

| Improve this Doc View Source

Block()

Initializes a new instance of the Block class.

Declaration
protected Block()

Fields

| Improve this Doc View Source

LineHeightProperty

Identifies the LineHeight dependency property.

Declaration
public static readonly DependencyProperty LineHeightProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

LineStackingStrategyProperty

Identifies the LineStackingStrategy dependency property.

Declaration
public static readonly DependencyProperty LineStackingStrategyProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

TextAlignmentProperty

Identifies the TextAlignment dependency property.

Declaration
public static readonly DependencyProperty TextAlignmentProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

LineHeight

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.

| Improve this Doc View Source

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
| Improve this Doc View Source

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 Source

GetLineHeight(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
UIElementExtendedRoutedEventExtensions.AddHandler(UIElement, ExtendedRoutedEvent, Delegate, Boolean)
UIElementExtendedRoutedEventExtensions.RemoveHandler(UIElement, ExtendedRoutedEvent, Delegate)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
  • Improve this Doc
  • View Source