MarkdownNode
Namespace: Hex1b.Nodes
Assembly: Hex1b.dll
Render node for . Parses markdown source into an AST, builds a widget tree via , and delegates layout and rendering to the composed child node.
public sealed class MarkdownNode : Hex1bNodeInheritance
Object → Hex1bNode → MarkdownNode
Properties
BlockHandlers
The block handler chain from the widget.
Returns: ImmutableList<Type, Delegate>>
public ImmutableList<(Type BlockType, Delegate Handler)> BlockHandlers { get; set; }ContentChild
The reconciled child node (typically a VStackNode).
Returns: Hex1bNode
public Hex1bNode? ContentChild { get; set; }Document
The backing , if the widget was constructed from one.
Returns: IHex1bDocument
public IHex1bDocument? Document { get; set; }DocumentVersion
The at the time the source was last extracted. Used for efficient change detection.
Returns: Int64
public long DocumentVersion { get; set; }FocusableChildren
When true, links within the content become focusable nodes.
Returns: Boolean
public bool FocusableChildren { get; set; }ImageLoader
Callback for loading and decoding images.
Returns: MarkdownImageLoader
public MarkdownImageLoader? ImageLoader { get; set; }IsFocusable
Returns true if this node can receive focus.
Returns: Boolean
public override bool IsFocusable { get; }LinkActivatedHandler
Handler invoked when a link is activated.
Returns: Func<MarkdownLinkActivatedEventArgs, Task>
public Func<MarkdownLinkActivatedEventArgs, Task>? LinkActivatedHandler { get; set; }Source
The markdown source text.
Returns: String
public string Source { get; set; }SourceWidget
The source widget for building event args.
Returns: MarkdownWidget
public MarkdownWidget? SourceWidget { get; set; }Methods
ArrangeCore(Rect)
Override this method to implement arranging logic for this node. The base implementation saves previous bounds, marks dirty on change, and sets bounds.
Parameters:
bounds(Rect):
protected override void ArrangeCore(Rect bounds)GetChildren()
Gets the direct children of this node for structural tree traversal. Container nodes should override this to return their children.
Returns: IEnumerable<Hex1bNode>
public override IEnumerable<Hex1bNode> GetChildren()GetFocusableNodes()
Gets all focusable nodes in this subtree (including this node if focusable).
Returns: IEnumerable<Hex1bNode>
public override IEnumerable<Hex1bNode> GetFocusableNodes()MeasureCore(Constraints)
Override this method to implement measuring logic for this node.
Parameters:
constraints(Constraints):
Returns: Size
protected override Size MeasureCore(Constraints constraints)Render(Hex1bRenderContext)
Renders the node to the given context.
Parameters:
context(Hex1bRenderContext):
public override void Render(Hex1bRenderContext context)