InfoBarExtensions
Namespace: Hex1b
Assembly: Hex1b.dll
Extension methods for building InfoBar widgets.
csharp
public static class InfoBarExtensionsInheritance
Object → InfoBarExtensions
Methods
InfoBar<TParent>(WidgetContext<TParent>, Func<InfoBarContext, IEnumerable<IInfoBarChild>>, bool)
Creates an InfoBar widget using a builder pattern.
Parameters:
ctx(WidgetContext<<TParent>>): The widget context.builder(Func<InfoBarContext, IInfoBarChild>>): A function that builds the info bar children using an InfoBarContext.invertColors(Boolean): Whether to invert foreground/background colors (default: true).
Returns: InfoBarWidget
An InfoBarWidget.
csharp
public static InfoBarWidget InfoBar<TParent>(this WidgetContext<TParent> ctx, Func<InfoBarContext, IEnumerable<IInfoBarChild>> builder, bool invertColors = true) where TParent : Hex1bWidgetInfoBar<TParent>(WidgetContext<TParent>, IEnumerable<IInfoBarChild>, bool)
Creates an InfoBar widget with pre-built children.
Parameters:
ctx(WidgetContext<<TParent>>): The widget context.children(IEnumerable<IInfoBarChild>): The info bar children.invertColors(Boolean): Whether to invert foreground/background colors (default: true).
Returns: InfoBarWidget
An InfoBarWidget.
csharp
public static InfoBarWidget InfoBar<TParent>(this WidgetContext<TParent> ctx, IEnumerable<IInfoBarChild> children, bool invertColors = true) where TParent : Hex1bWidgetInfoBar<TParent>(WidgetContext<TParent>, IReadOnlyList<InfoBarSection>, bool)
Creates an InfoBar widget with legacy InfoBarSection objects.
Parameters:
ctx(WidgetContext<<TParent>>): The widget context.sections(IReadOnlyList<InfoBarSection>): The sections to display.invertColors(Boolean): Whether to invert foreground/background colors (default: true).
Returns: InfoBarWidget
csharp
public static InfoBarWidget InfoBar<TParent>(this WidgetContext<TParent> ctx, IReadOnlyList<InfoBarSection> sections, bool invertColors = true) where TParent : Hex1bWidgetInfoBar<TParent>(WidgetContext<TParent>, params string[])
Creates a simple InfoBar widget with text sections.
Parameters:
ctx(WidgetContext<<TParent>>): The widget context.texts(String[]): The text strings to display as sections.
Returns: InfoBarWidget
csharp
public static InfoBarWidget InfoBar<TParent>(this WidgetContext<TParent> ctx, params string[] texts) where TParent : Hex1bWidgetInfoBar<TParent>(WidgetContext<TParent>, string, bool)
Creates an InfoBar widget with a single text section.
Parameters:
ctx(WidgetContext<<TParent>>): The widget context.text(String): The text to display.invertColors(Boolean): Whether to invert foreground/background colors (default: true).
Returns: InfoBarWidget
csharp
public static InfoBarWidget InfoBar<TParent>(this WidgetContext<TParent> ctx, string text, bool invertColors = true) where TParent : Hex1bWidgetSection(string, Hex1bColor?, Hex1bColor?)
Creates an InfoBarSection with styling.
Parameters:
text(String): The text content.foreground(Nullable<Hex1bColor>): Optional foreground color.background(Nullable<Hex1bColor>): Optional background color.
Returns: InfoBarSection
csharp
[Obsolete("Use the builder pattern: ctx.InfoBar(s => [s.Section(...)]) instead.")]
public static InfoBarSection Section(string text, Hex1bColor? foreground = null, Hex1bColor? background = null)