XenoAtom.Terminal.UI formats values using a configurable CultureInfo.
This affects common UI scenarios such as:
DataPresenter<T>, list item templates, etc.)Slider<T>)By default, the culture is CultureInfo.InvariantCulture (stable formatting across machines and locales).
Terminal.Run)using System.Globalization;
using XenoAtom.Terminal.UI;
Terminal.Run(
visual,
onUpdate,
new TerminalRunOptions
{
Culture = CultureInfo.GetCultureInfo("fr-FR"),
});
Terminal.Live)using System.Globalization;
using XenoAtom.Terminal.UI;
Terminal.Live(
visual,
onUpdate,
new TerminalLiveOptions
{
Culture = CultureInfo.GetCultureInfo("fr-FR"),
});
You can override formatting for a specific subtree by setting CultureStyle in the environment:
using System.Globalization;
using XenoAtom.Terminal.UI.Styling;
root.Style(CultureStyle.Default with
{
Culture = CultureInfo.GetCultureInfo("fr-FR"),
});
This is useful when you want most of the UI to use one culture, but a specific panel to use another.
Controls and templates should prefer using Visual helpers rather than calling ToString() directly:
Visual.ToStringValue<T>(T value, string? format = null)Visual.ToStringObject(object? value, string? format = null)These helpers automatically pick up the resolved culture.