Skip to content

message vs modal components API #18

@quinchs

Description

@quinchs

Summary

A way to distinguish between message components and modal components is necessary for constraints in order to provide correct compile time validation.

Proposed API:

public static class ComponentDesigner
{
    public static CXMessageComponent message(string cx, bool? autoRows = null, bool? autoTextDisplays = null);
    public static CXMessageComponent message(DesignerInterpolationHandler cx, bool? autoRows = null, bool? autoTextDisplays = null);

    public static CXModalComponent modal(string cx, bool? autoRows = null, bool? autoTextDisplays = null);
    public static CXModalComponent modal(DesignerInterpolationHandler cx, bool? autoRows = null, bool? autoTextDisplays = null);
}

Using different function names indicates to the consumer the constraint applied to the components, as well as how they're used, with different return types further carrying that validation to other stages outside the scope of the component designer.

The lowercase naming strategy is irregular, but intended to indicate that the call is templated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions