@inherits RadzenComponent

@if (Visible)
{
    <div @ref=@Element id=@GetId() style=@GetGridStyle() @attributes=@Attributes class=@GetCssClass()>
        <div @ref=@cellsElement id="@(GetId())-cells"
             class="rz-tile-layout-cells @(EditMode ? "rz-tile-layout-editable" : null) @(activeItem != null ? "rz-tile-layout-dragging" : null)"
             style=@GetCellsStyle()
             @onpointermove=@OnPointerMove
             @onpointerup=@OnPointerUp
             @onpointercancel=@OnPointerUp
             @onlostpointercapture=@OnPointerUp>
            <CascadingValue Value=@this IsFixed=true>
                @ChildContent
            </CascadingValue>
            @if (ShowGrid)
            {
                <div class="rz-tile-layout-overlay" style=@GetOverlayStyle() aria-hidden="true">
                    @for (var r = 1; r <= OverlayRows; r++)
                    {
                        @for (var c = 1; c <= Columns; c++)
                        {
                            <div class="rz-tile-layout-overlay-cell" style=@GetOverlayCellStyle(c, r)></div>
                        }
                    }
                </div>
            }
        </div>
    </div>
}
