Table of Contents

Class HtmxConfig

Namespace
Ramstack.HtmxToolkit.Configuration
Assembly
Ramstack.HtmxToolkit.dll

Represents configuration for a specific major version of HTMX.

public abstract class HtmxConfig
Inheritance
HtmxConfig
Derived
Inherited Members

Remarks

Configuration JSON is cached until a configuration property is assigned. Changes made in place to arrays, collections, or their items do not invalidate the cache; reassign the containing property after making such changes.

Properties

TargetVersion

Gets the configured HTMX major version.

[JsonIgnore]
public HtmxTargetVersion TargetVersion { get; }

Property Value

HtmxTargetVersion

Methods

Serialize()

Serializes this configuration to a JSON string.

protected abstract string Serialize()

Returns

string

A JSON string representing this configuration.

SetField<T>(ref T, T)

Assigns value to field and invalidates the cached JSON so it is regenerated on the next serialization.

protected void SetField<T>(ref T field, T value)

Parameters

field T

The backing field to update.

value T

The value to assign.

Type Parameters

T

The type of the field.