Table of Contents

Class TrinityComponent<T, TDeserialization>

Namespace
AbanoubNassem.Trinity.Components
Assembly
AbanoubNassem.Trinity.dll

The Basic Trinity Component definition.

public abstract class TrinityComponent<T, TDeserialization> : ITrinityComponent where T : TrinityComponent<T, TDeserialization>

Type Parameters

T
TDeserialization
Inheritance
TrinityComponent<T, TDeserialization>
Implements
Derived
Inherited Members

Properties

ColumnSpan

Specify the number of columns that component may span in the parent grid.

public virtual int ColumnSpan { get; protected set; }

Property Value

int

ComponentName

The component name in the front-end side.

public abstract string ComponentName { get; }

Property Value

string

Configurations

A reference to the TrinityConfigurations singleton.

protected TrinityConfigurations Configurations { get; init; }

Property Value

TrinityConfigurations

DefaultValue

Component default value.

public TDeserialization? DefaultValue { get; protected set; }

Property Value

TDeserialization

Disabled

Whether the component is disabled or not.

public bool Disabled { get; protected set; }

Property Value

bool

Hidden

Whether the component is hidden or not.

public bool Hidden { get; set; }

Property Value

bool

Id

A unique identifier for the component.

public string Id { get; }

Property Value

string

IsToggledHiddenByDefault

Whether the the taggable component is hidden by default or not.

public bool IsToggledHiddenByDefault { get; protected set; }

Property Value

bool

Label

the displayable label of the component.

public virtual string Label { get; protected set; }

Property Value

string

Localizer

A reference to the TrinityLocalizer singleton.

protected TrinityLocalizer Localizer { get; init; }

Property Value

TrinityLocalizer

ServiceProvider

A reference to the app IServiceProvider.

protected IServiceProvider ServiceProvider { get; init; }

Property Value

IServiceProvider

Style

Component Style.

public Dictionary<string, object>? Style { get; protected set; }

Property Value

Dictionary<string, object>

Toggleable

Hide or show the component.

public bool Toggleable { get; protected set; }

Property Value

bool

Tooltip

Component tooltip.

public string? Tooltip { get; protected set; }

Property Value

string

Type

Used on the front-end side to determine what type is the component , is it (field, columns , etc).

public abstract string Type { get; }

Property Value

string

Visible

Whether the component is visible or not.

public bool Visible { get; set; }

Property Value

bool

Methods

SetAsDisabled(bool)

Set whether the component is disabled or not.

public T SetAsDisabled(bool value = true)

Parameters

value bool

whether the component is disabled or not.

Returns

T

The current component. for further chaining.

See Also

SetAsHidden(bool)

Set whether the component is hidden or not.

public T SetAsHidden(bool value = true)

Parameters

value bool

whether the component is hidden or not.

Returns

T

The current component. for further chaining.

See Also

SetAsToggleable(bool, bool)

Set the component as a toggleable component.

public T SetAsToggleable(bool toggleable = true, bool isToggledHiddenByDefault = true)

Parameters

toggleable bool

Whether is toggleable or not.

isToggledHiddenByDefault bool

Whether if it should be hidden by default.

Returns

T

The current component. for further chaining.

See Also

SetAsVisible(bool)

Set whether the component is visible or not.

public T SetAsVisible(bool value = true)

Parameters

value bool

whether the component is visible or not.

Returns

T

The current component. for further chaining.

See Also

SetColumnSpan(int)

Sets the number of columns spanned by the control.

public T SetColumnSpan(int columnSpan = 0)

Parameters

columnSpan int

The number of columns spanned by the control.

Returns

T

The current component. for further chaining.

See Also

SetDefaultValue(TDeserialization)

Set the component default value.

public T SetDefaultValue(TDeserialization value)

Parameters

value TDeserialization

Set the default value of the component.

Returns

T

The current component. for further chaining.

See Also

SetId(string)

Set the unique identifier of the component.

public T SetId(string value)

Parameters

value string

The Id value

Returns

T

The current component. for further chaining.

See Also

SetLabel(string)

Set the component Label.

public T SetLabel(string value)

Parameters

value string

component label.

Returns

T

The current component. for further chaining.

See Also

SetStyle(Dictionary<string, object>)

Set component style.

public T SetStyle(Dictionary<string, object> style)

Parameters

style Dictionary<string, object>

The style of component to be applied.

Returns

T

The current component. for further chaining.

See Also

SetTooltip(string)

Set Component tooltip.

public T SetTooltip(string toolTip)

Parameters

toolTip string

Tooltip to be displayed.

Returns

T

The current component. for further chaining.

See Also

Setup()

Setup is being called on each request, once the Component is resolved. Can be used to resolve extra Services or do some logic before using the Component.

public virtual void Setup()