Class BOBInputSwitch
- Namespace
- BlazOrbit.Components.Forms
- Assembly
- BlazOrbit.dll
[GenerateComponentInfo]
public class BOBInputSwitch : BOBInputComponentBase<bool, BOBInputSwitch, BOBInputSwitchVariant>, IHasReadOnly, IHasDisabled, IHasRequired, IHasError, IVariantComponent<BOBInputSwitchVariant>, IVariantComponent, IHasSize, IHasDensity
- Inheritance
-
objectComponentBaseInputBase<bool>BOBInputComponentBase<bool>BOBInputSwitch
- Implements
- Inherited Members
Constructors
BOBInputSwitch()
public BOBInputSwitch()
Properties
BuiltInTemplates
protected override IReadOnlyDictionary<BOBInputSwitchVariant, Func<BOBInputSwitch, RenderFragment>> BuiltInTemplates { get; }
Property Value
- IReadOnlyDictionary<BOBInputSwitchVariant, Func<BOBInputSwitch, RenderFragment>>
DefaultVariant
Default variant used when no explicit variant is specified.
public override BOBInputSwitchVariant DefaultVariant { get; }
Property Value
Density
Vertical density (gap) of the component.
[Parameter]
public BOBDensity Density { get; set; }
Property Value
HelperText
Helper text displayed below the component for additional context.
[Parameter]
public string? HelperText { get; set; }
Property Value
- string
IconActive
IconActive.
[Parameter]
public IconKey? IconActive { get; set; }
Property Value
IconInactive
IconInactive.
[Parameter]
public IconKey? IconInactive { get; set; }
Property Value
IsChecked
protected bool IsChecked { get; }
Property Value
- bool
Label
Floating label displayed above the component.
[Parameter]
public string? Label { get; set; }
Property Value
- string
Size
Visual size of the component.
[Parameter]
public BOBSize Size { get; set; }
Property Value
TrackColorActive
TrackColorActive.
[Parameter]
public string? TrackColorActive { get; set; }
Property Value
- string
TrackColorInactive
TrackColorInactive.
[Parameter]
public string? TrackColorInactive { get; set; }
Property Value
- string
Methods
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builderRenderTreeBuilder
TryParseValueFromString(string?, out bool, out string)
Parses a string to create an instance of bool. Derived classes can override this to change how Microsoft.AspNetCore.Components.Forms.InputBase<TValue>.CurrentValueAsString interprets incoming values.
protected override bool TryParseValueFromString(string? value, out bool result, out string validationErrorMessage)
Parameters
valuestringThe string value to be parsed.
resultboolAn instance of bool.
validationErrorMessagestringIf the value could not be parsed, provides a validation error message.
Returns
- bool
True if the value could be parsed; otherwise false.