syncfusion-maui-listview

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Implementing .NET MAUI ListView

实现.NET MAUI ListView

A comprehensive skill for implementing, customizing, and optimizing the Syncfusion .NET MAUI ListView (SfListView) component. The ListView displays collections of data with support for layouts, sorting, filtering, grouping, selection, and rich customization options.
这是一份关于实现、自定义和优化Syncfusion .NET MAUI ListView(SfListView)组件的全面指南。该ListView可展示数据集合,支持布局设置、排序、筛选、分组、选择以及丰富的自定义选项。

When to Use This Skill

何时使用此技能

Use this skill when you need to:
  • Display Collections: Show lists of data items from any data source (ObservableCollection, List, etc.)
  • Data Operations: Implement sorting, filtering, or grouping of list items
  • Custom Layouts: Create linear or grid layouts with single or multiple columns
  • User Interaction: Enable item selection (single/multiple), tapping, long-press, or double-tap
  • Advanced Features: Add swipe actions, drag-and-drop reordering, pull-to-refresh, or load more
  • Customization: Design custom item templates, headers, footers, or group headers
  • Performance: Optimize list rendering for large datasets with virtualization
  • MVVM Patterns: Implement ListView with data binding, commands, and ViewModels
Common Scenarios:
  • Product catalogs, contact lists, inbox/email lists
  • News feeds, social media posts, photo galleries
  • Settings pages, navigation menus, file browsers
  • Task lists, order history, transaction records
  • Any scrollable collection of similar items
当你需要以下功能时,可使用本技能:
  • 展示数据集合:显示来自任意数据源(ObservableCollection、List等)的数据项列表
  • 数据操作:实现列表项的排序、筛选或分组
  • 自定义布局:创建单列或多列的线性布局或网格布局
  • 用户交互:启用项选择(单选/多选)、点击、长按或双击操作
  • 高级功能:添加滑动操作、拖拽重排、下拉刷新或加载更多功能
  • 自定义设置:设计自定义项模板、页眉、页脚或分组页眉
  • 性能优化:通过虚拟化优化大数据集的列表渲染
  • MVVM模式:结合数据绑定、命令和ViewModel实现ListView
常见场景:
  • 产品目录、联系人列表、收件箱/邮件列表
  • 新闻推送、社交媒体帖子、图片画廊
  • 设置页面、导航菜单、文件浏览器
  • 任务列表、订单历史、交易记录
  • 任何包含相似项的可滚动集合

Component Overview

组件概述

SfListView is a high-performance, feature-rich list control that:
  • Renders data items using built-in or custom templates
  • Supports optimized view reusing strategy for smooth scrolling
  • Provides linear and grid layouts with orientation support
  • Enables data operations (sort, filter, group) without re-binding
  • Offers multiple selection modes and gestures
  • Includes sticky headers, footers, and group headers
  • Supports item swipe actions and drag-and-drop
  • Handles large datasets efficiently with virtualization
SfListView是一款高性能、功能丰富的列表控件,具备以下特性:
  • 使用内置或自定义模板渲染数据项
  • 支持优化的视图复用策略,实现流畅滚动
  • 支持线性和网格布局,且可设置方向
  • 无需重新绑定即可实现数据操作(排序、筛选、分组)
  • 提供多种选择模式和手势支持
  • 包含粘性页眉、页脚和分组页眉
  • 支持项滑动操作和拖拽功能
  • 通过虚拟化高效处理大数据集

Documentation and Navigation Guide

文档与导航指南

Getting Started

入门指南

📄 Read: references/getting-started.md
  • NuGet package setup (Syncfusion.Maui.ListView)
  • Registering handlers in MauiProgram.cs
  • Creating your first ListView
  • Data models and ViewModels
  • Basic data binding and item templates
📄 阅读: references/getting-started.md
  • NuGet包设置(Syncfusion.Maui.ListView)
  • 在MauiProgram.cs中注册处理程序
  • 创建你的第一个ListView
  • 数据模型与ViewModel
  • 基础数据绑定和项模板

Layout Options

布局选项

📄 Read: references/layouts.md
  • Linear layout (vertical/horizontal)
  • Grid layout with SpanCount
  • Changing layouts dynamically
  • Responsive column count based on screen size
  • Layout best practices
📄 阅读: references/layouts.md
  • 线性布局(垂直/水平)
  • 带SpanCount的网格布局
  • 动态切换布局
  • 基于屏幕尺寸的响应式列数
  • 布局最佳实践

Data Operations

数据操作

📄 Read: references/data-operations.md
  • Sorting with SortDescriptor (ascending/descending, custom comparers)
  • Filtering with predicates and RefreshFilter
  • Grouping with GroupDescriptor and sticky group headers
  • Combining multiple operations
  • Performance considerations
📄 阅读: references/data-operations.md
  • 使用SortDescriptor进行排序(升序/降序、自定义比较器)
  • 使用谓词和RefreshFilter进行筛选
  • 使用GroupDescriptor和粘性分组页眉进行分组
  • 组合多种操作
  • 性能注意事项

Selection

选择功能

📄 Read: references/selection.md
  • Selection modes (None, Single, SingleDeselect, Multiple, Extended)
  • Selection gestures (Tap, DoubleTap, Hold)
  • SelectedItem and SelectedItems properties
  • Selection events (SelectionChanging, SelectionChanged)
  • Programmatic selection
  • Customizing selection appearance
📄 阅读: references/selection.md
  • 选择模式(None、Single、SingleDeselect、Multiple、Extended)
  • 选择手势(点击、双击、长按)
  • SelectedItem和SelectedItems属性
  • 选择事件(SelectionChanging、SelectionChanged)
  • 程序化选择
  • 自定义选择外观

Item Customization

项自定义

📄 Read: references/item-customization.md
  • Custom item templates with ItemTemplate
  • DataTemplateSelector for dynamic templates
  • Item sizing (fixed, auto-fit, dynamic)
  • Item appearance (borders, spacing, visual effects)
  • Liquid glass effect
  • Advanced customization techniques
📄 阅读: references/item-customization.md
  • 使用ItemTemplate创建自定义项模板
  • 使用DataTemplateSelector实现动态模板
  • 项尺寸设置(固定、自适应、动态)
  • 项外观(边框、间距、视觉效果)
  • 液态玻璃效果
  • 高级自定义技巧

Headers and Footers

页眉与页脚

📄 Read: references/headers-footers.md
  • Adding HeaderTemplate and FooterTemplate
  • Sticky headers and footers (IsStickyHeader, IsStickyFooter)
  • Group headers with GroupHeaderTemplate
  • Dynamic header/footer content
  • Common header/footer patterns
📄 阅读: references/headers-footers.md
  • 添加HeaderTemplate和FooterTemplate
  • 粘性页眉和页脚(IsStickyHeader、IsStickyFooter)
  • 使用GroupHeaderTemplate设置分组页眉
  • 动态页眉/页脚内容
  • 常见页眉/页脚模式

Interactive Features

交互功能

📄 Read: references/interactive-features.md
  • Swipe actions (StartSwipeTemplate, EndSwipeTemplate)
  • Swipe events and common patterns (delete, archive)
  • Drag and drop (DragStartMode, drag/drop events)
  • Reordering items within list
  • Cross-list drag and drop
📄 阅读: references/interactive-features.md
  • 滑动操作(StartSwipeTemplate、EndSwipeTemplate)
  • 滑动事件和常见模式(删除、归档)
  • 拖拽功能(DragStartMode、拖拽事件)
  • 列表内项重排
  • 跨列表拖拽

Load More and Pull to Refresh

加载更多与下拉刷新

📄 Read: references/load-more-pull-refresh.md
  • Load more options (auto/manual)
  • LoadMoreCommand and LoadMoreTemplate
  • Pull to refresh
  • Best practices for large datasets
📄 阅读: references/load-more-pull-refresh.md
  • 加载更多选项(自动/手动)
  • LoadMoreCommand和LoadMoreTemplate
  • 下拉刷新
  • 大数据集最佳实践

Scrolling

滚动功能

📄 Read: references/scrolling.md
  • Scroll methods (ScrollTo, ScrollToRowIndex)
  • ScrollBarVisibility property
  • Programmatic scrolling
  • ListView without virtualization
  • Performance optimization for scrolling
📄 阅读: references/scrolling.md
  • 滚动方法(ScrollTo、ScrollToRowIndex)
  • ScrollBarVisibility属性
  • 程序化滚动
  • 无虚拟化的ListView
  • 滚动性能优化

Right-to-Left (RTL) Support

从右到左(RTL)支持

📄 Read: references/rtl.md
  • Right-to-Left (RTL) layout support
  • FlowDirection property
  • Testing RTL layouts
📄 阅读: references/rtl.md
  • 从右到左(RTL)布局支持
  • FlowDirection属性
  • RTL布局测试

MVVM Patterns

MVVM模式

📄 Read: references/mvvm-patterns.md
  • MVVM architecture with ListView
  • INotifyPropertyChanged and ObservableCollection
  • Commands (TapCommand, LongPressCommand)
  • Data binding patterns
  • Handling user actions in MVVM
  • Complete MVVM example
📄 阅读: references/mvvm-patterns.md
  • 结合ListView的MVVM架构
  • INotifyPropertyChanged和ObservableCollection
  • 命令(TapCommand、LongPressCommand)
  • 数据绑定模式
  • 在MVVM中处理用户操作
  • 完整MVVM示例

Events and Performance

事件与性能

📄 Read: references/events-performance.md
  • Lifecycle events (Loaded)
  • Interaction events (ItemTapped, ItemDoubleTapped, ItemLongPress)
  • ItemAppearing and ItemDisappearing events
  • Performance optimization techniques
  • Using BeginInit/EndInit for batch updates
  • RefreshView method
  • Troubleshooting performance issues
📄 阅读: references/events-performance.md
  • 生命周期事件(Loaded)
  • 交互事件(ItemTapped、ItemDoubleTapped、ItemLongPress)
  • ItemAppearing和ItemDisappearing事件
  • 性能优化技巧
  • 使用BeginInit/EndInit进行批量更新
  • RefreshView方法
  • 性能问题排查