Skip to content

Error with Grid Basic Usage Example in Docs #6

@alastairlundy

Description

@alastairlundy

Hi,
I noticed whilst looking at the docs for XenoAtom.Terminal.UI that on the Grid page the basic usage example contains a few issues.

When trying to copy the basic usage example with XenoAtom.Terminal.UI 2.2.0 onwards (including 2.5.0) in a project, Jetbrains Rider says that ColumnDefinition's constructor takes zero parameters whilst the usage examples shows the GridLength being provided as a parameter. The same is true for the RowDefinition constructor not accepting any parameters with the example showing a GridLength parameter used.

This is the basic usage example from the Grid page.

new Grid()
    .Columns(new ColumnDefinition(GridLength.Auto), new ColumnDefinition(GridLength.Star))
    .Rows(new RowDefinition(GridLength.Auto), new RowDefinition(GridLength.Auto))
    .Cell("Name:", row: 0, column: 0)
    .Cell(new TextBox("Alex"), row: 0, column: 1);

And here are the error messages:
Constructor 'ColumnDefinition' has 0 parameter(s) but is invoked with 1 argument(s)
Constructor 'RowDefinition' has 0 parameter(s) but is invoked with 1 argument(s)

I believe this is the correct version of the basic usage example:

new Grid()
    .Columns(new ColumnDefinition().Width(GridLength.Auto), 
new ColumnDefinition().Width(GridLength.Star))
    .Rows(new RowDefinition().Height(GridLength.Auto),
 new RowDefinition().Height(GridLength.Auto))
    .Cell("Name:", row: 0, column: 0)
    .Cell(new TextBox("Alex"), row: 0, column: 1);

Thanks for creating this project.

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