MarkupLabelElement Class
Provides the base class for a MarkupLabel element.
public abstract class MarkupLabelElement : LogicalTreeNodeBase, IDisposable, ILogicalTreeNode
- Inheritance:
- object MarshalByRefObject MarshalByRefDisposableObject LogicalTreeNodeBase object
- Derived:
- MarkupLabelAnchorElement MarkupLabelBodyElement MarkupLabelBoldElement MarkupLabelEmphasisElement MarkupLabelImageElement MarkupLabelItalicElement MarkupLabelLineBreakElement MarkupLabelSpanElement MarkupLabelStrongElement MarkupLabelTextElement MarkupLabelUnderlineElement
- Implements:
- IDisposable ILogicalTreeNode
Constructors
MarkupLabelElement(string?)
Initializes an instance of the class.
public MarkupLabelElement(string? elementName)
| Parameter | Type | Description |
|---|---|---|
| elementName | string | The name of the element represented by this class. |
Properties
Children
The collection of child objects.
ClassName
The class name of the element.
CssData
The MarkupLabelCssData specifying CSS data for the element.
DpiScaleFactor
The DPI scale factor to be applied when rendering the element, where Width is applied to the x-axis, and Height is applied to the y-axis.
ElementName
The name of the element represented by this class.
Id
The id of the element.
MarkupLabel
The MarkupLabel that owns the element.
Parent
The object that is parent to this object.
Style
The CSS style string for the element.
VerticalAlignment
A MarkupLabelElementVerticalAlignment indicating the vertical alignment.
public MarkupLabelElementVerticalAlignment VerticalAlignment { get; set; }
Property Value
Methods
CreateChildren()
Invoked when the collection of child elements is to be created.
protected override IList<ILogicalTreeNode>? CreateChildren()
Returns
- IList<ILogicalTreeNode>:
The list that should be assigned to the Children property.
Remarks
By default, a null value is returned.
CreateUIElement(IUIElement)
Creates the IUIElement tree from the element.
protected virtual void CreateUIElement(IUIElement parentUIElement)
| Parameter | Type | Description |
|---|---|---|
| parentUIElement | IUIElement | The parent IUIElement. |
GetBackColor(UIElementDrawState)
Returns the background Color to use for drawing the element.
public virtual Color GetBackColor(UIElementDrawState drawState)
| Parameter | Type | Description |
|---|---|---|
| drawState | UIElementDrawState | A UIElementDrawState indicating the draw state. |
Returns
GetDefaultCssData()
Returns the default MarkupLabelCssData for the element.
GetFont()
Returns the Font to use for drawing text in the element.
GetFont(string?, float, MarkupLabelFontWeight, MarkupLabelFontStyle, MarkupLabelTextDecoration, UIElementDrawState)
Returns the Font to use for drawing text in the element.
public virtual Font GetFont(string? fontFamily, float fontSize, MarkupLabelFontWeight fontWeight, MarkupLabelFontStyle fontStyle, MarkupLabelTextDecoration textDecoration, UIElementDrawState drawState)
| Parameter | Type | Description |
|---|---|---|
| fontFamily | string | The font family. |
| fontSize | float | The font size. |
| fontWeight | MarkupLabelFontWeight | A MarkupLabelFontWeight indicating the font weight. |
| fontStyle | MarkupLabelFontStyle | A MarkupLabelFontStyle indicating the font style. |
| textDecoration | MarkupLabelTextDecoration | A MarkupLabelTextDecoration indicating the text decoration. |
| drawState | UIElementDrawState | A UIElementDrawState indicating the draw state. |
Returns
GetForeColor(UIElementDrawState)
The foreground Color to use for drawing the element.
public virtual Color GetForeColor(UIElementDrawState drawState)
| Parameter | Type | Description |
|---|---|---|
| drawState | UIElementDrawState | A UIElementDrawState indicating the draw state. |
Returns
ToString()
Returns the string representation of this object.
Inherited Members
- LogicalTreeNodeBase.OnParentChanged()
- MarshalByRefDisposableObject.Dispose()
- MarshalByRefDisposableObject.Dispose(bool)
- MarshalByRefDisposableObject.VerifyNotDisposed()
- MarshalByRefDisposableObject.IsDisposed
- MarshalByRefDisposableObject.Disposed
- MarshalByRefObject.GetLifetimeService()
- MarshalByRefObject.InitializeLifetimeService()
- MarshalByRefObject.MemberwiseClone(bool)
- object.GetType()
- object.MemberwiseClone()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()
Extension Methods
- ILogicalTreeNodeExtensions.FindCommonLogicalAncestor(ILogicalTreeNode, ILogicalTreeNode)
- ILogicalTreeNodeExtensions.FindLogicalAncestorOfType<T>(ILogicalTreeNode, bool)
- ILogicalTreeNodeExtensions.FindLogicalDescendantOfType<T>(ILogicalTreeNode, bool)
- ILogicalTreeNodeExtensions.GetLogicalAncestors(ILogicalTreeNode)
- ILogicalTreeNodeExtensions.GetLogicalChildren(ILogicalTreeNode)
- ILogicalTreeNodeExtensions.GetLogicalDescendants(ILogicalTreeNode)
- ILogicalTreeNodeExtensions.GetLogicalParent(ILogicalTreeNode)
- ILogicalTreeNodeExtensions.GetLogicalParent<T>(ILogicalTreeNode)
- ILogicalTreeNodeExtensions.GetLogicalSiblings(ILogicalTreeNode)
- ILogicalTreeNodeExtensions.GetSelfAndLogicalAncestors(ILogicalTreeNode)
- ILogicalTreeNodeExtensions.GetSelfAndLogicalDescendants(ILogicalTreeNode)
- ILogicalTreeNodeExtensions.IsLogicalAncestorOf(ILogicalTreeNode, ILogicalTreeNode)
- ObjectExtensions.TryConvertToDouble(object, out double)
- ObjectExtensions.TryConvertToDouble(object, IFormatProvider, out double)