Skip to content

New Demo Example for using X.PagedList with Ivy Framework#212

Merged
rorychatt merged 1 commit into
Ivy-Interactive:mainfrom
bigboybamo:feature/xpagedListDemp
Oct 7, 2025
Merged

New Demo Example for using X.PagedList with Ivy Framework#212
rorychatt merged 1 commit into
Ivy-Interactive:mainfrom
bigboybamo:feature/xpagedListDemp

Conversation

@bigboybamo

Copy link
Copy Markdown
Contributor

Summary
Adds a new Ivy example XpagedList showcasing how to create paged lists using the X.PagedList NuGet package inside an Ivy app.

Implements: #192

What’s included

  • XPagedListExample/XPagedListExample.csproj — project with references to Ivy and X.PagedList
  • XPagedListExample/Program.cs — Ivy server bootstrap (Hot Reload in Debug, default app wired)
  • XPagedListExample/GlobalUsings.cs — common Ivy namespaces for fluent helpers (Layout, Text, Button, etc.)
  • XPagedListExample/Apps/XpagedList.cs — UI + paging logic using UseState<T>(T?, bool) and X.PagedList
  • XPagedListExample/README.md — quick run instructions

Features demonstrated

  • Real paging with X.PagedList: 53 items (Item 1..53), page size = 10
  • Prev/Next navigation with disabled states via HasPreviousPage / HasNextPage
  • Paging metadata UI: PageNumber, PageCount, TotalItemCount, FirstItemOnPage, LastItemOnPage
  • Extension-free construction for reliability: new PagedList<string>(items, pageNumber, pageSize)
  • No custom model: renders a simple list of strings
  • Ivy state pattern: uses the value overload UseState<T>(T?, bool) to avoid overload ambiguity

How it works

  • Data source: Enumerable.Range(1, 53).Select(i => $"Item {i}") stored with UseState<List<string>>(..., true)
  • State: pageNumber via UseState<int>(2, true); pageSize is a constant 10
  • Paging: create the current page with new PagedList<string>(items.Value, pageNumber.Value, pageSize)
  • Bounds safety: clamp pageNumber to [1 .. page.PageCount] if data changes
  • UI rendering:
    • Show metadata labels (page/total/first/last indices)
    • Render current page items via Text.Label(s)
    • Prev/Next buttons update pageNumber and are disabled based on HasPreviousPage/HasNextPage
chrome_ZY6V1ZdV5E chrome_CpYNab1zfc

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new demonstration example showing how to integrate X.PagedList with the Ivy Framework for creating paginated interfaces. The example demonstrates real pagination with navigation controls and metadata display.

  • Implements X.PagedList integration with Ivy's state management system
  • Demonstrates pagination UI with prev/next navigation and disabled states
  • Shows paging metadata display including page numbers, total counts, and item ranges

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
XPagedListExample.csproj Project configuration with Ivy and X.PagedList package references
README.md Documentation with run and deploy instructions for the demo
Program.cs Ivy server bootstrap configuration with hot reload and Chrome settings
GlobalUsings.cs Global using statements for Ivy namespaces and X.PagedList
XpagedList.cs Main demo app implementing pagination logic and UI components
.gitignore Standard ignore patterns for build artifacts and IDE files

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@rorychatt
rorychatt merged commit 09cef79 into Ivy-Interactive:main Oct 7, 2025
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants