Skip to content

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.

csharp
public sealed class MarkdownNode : Hex1bNode

Inheritance ​

Object → Hex1bNode → MarkdownNode

Properties ​

BlockHandlers ​

The block handler chain from the widget.

Returns: ImmutableList<Type, Delegate>>

csharp
public ImmutableList<(Type BlockType, Delegate Handler)> BlockHandlers { get; set; }

ContentChild ​

The reconciled child node (typically a VStackNode).

Returns: Hex1bNode

csharp
public Hex1bNode? ContentChild { get; set; }

Document ​

The backing , if the widget was constructed from one.

Returns: IHex1bDocument

csharp
public IHex1bDocument? Document { get; set; }

DocumentVersion ​

The at the time the source was last extracted. Used for efficient change detection.

Returns: Int64

csharp
public long DocumentVersion { get; set; }

FocusableChildren ​

When true, links within the content become focusable nodes.

Returns: Boolean

csharp
public bool FocusableChildren { get; set; }

ImageLoader ​

Callback for loading and decoding images.

Returns: MarkdownImageLoader

csharp
public MarkdownImageLoader? ImageLoader { get; set; }

IsFocusable ​

Returns true if this node can receive focus.

Returns: Boolean

csharp
public override bool IsFocusable { get; }

LinkActivatedHandler ​

Handler invoked when a link is activated.

Returns: Func<MarkdownLinkActivatedEventArgs, Task>

csharp
public Func<MarkdownLinkActivatedEventArgs, Task>? LinkActivatedHandler { get; set; }

Source ​

The markdown source text.

Returns: String

csharp
public string Source { get; set; }

SourceWidget ​

The source widget for building event args.

Returns: MarkdownWidget

csharp
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:

csharp
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>

csharp
public override IEnumerable<Hex1bNode> GetChildren()

GetFocusableNodes() ​

Gets all focusable nodes in this subtree (including this node if focusable).

Returns: IEnumerable<Hex1bNode>

csharp
public override IEnumerable<Hex1bNode> GetFocusableNodes()

MeasureCore(Constraints) ​

Override this method to implement measuring logic for this node.

Parameters:

Returns: Size

csharp
protected override Size MeasureCore(Constraints constraints)

Render(Hex1bRenderContext) ​

Renders the node to the given context.

Parameters:

csharp
public override void Render(Hex1bRenderContext context)

Released under the MIT License.