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
ComponentName
The component name in the front-end side.
public abstract string ComponentName { get; }
Property Value
Configurations
A reference to the TrinityConfigurations singleton.
protected TrinityConfigurations Configurations { get; init; }
Property Value
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
Hidden
Whether the component is hidden or not.
public bool Hidden { get; set; }
Property Value
Id
A unique identifier for the component.
public string Id { get; }
Property Value
IsToggledHiddenByDefault
Whether the the taggable component is hidden by default or not.
public bool IsToggledHiddenByDefault { get; protected set; }
Property Value
Label
the displayable label of the component.
public virtual string Label { get; protected set; }
Property Value
Localizer
A reference to the TrinityLocalizer singleton.
protected TrinityLocalizer Localizer { get; init; }
Property Value
ServiceProvider
A reference to the app IServiceProvider.
protected IServiceProvider ServiceProvider { get; init; }
Property Value
Style
Component Style.
public Dictionary<string, object>? Style { get; protected set; }
Property Value
Toggleable
Hide or show the component.
public bool Toggleable { get; protected set; }
Property Value
Tooltip
Component tooltip.
public string? Tooltip { get; protected set; }
Property Value
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
Visible
Whether the component is visible or not.
public bool Visible { get; set; }
Property Value
Methods
SetAsDisabled(bool)
Set whether the component is disabled or not.
public T SetAsDisabled(bool value = true)
Parameters
value
boolwhether 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
boolwhether 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
boolWhether is toggleable or not.
isToggledHiddenByDefault
boolWhether 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
boolwhether 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
intThe 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
TDeserializationSet 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
stringThe 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
stringcomponent 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
stringTooltip 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()