syncfusion-maui-calendar
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseImplementing .NET MAUI Calendar (SfCalendar)
实现.NET MAUI Calendar(SfCalendar)控件
A comprehensive skill for implementing and customizing the Syncfusion .NET MAUI Calendar control. The SfCalendar provides powerful date selection capabilities with multiple view modes, extensive customization options, and flexible date restrictions.
这是一份关于实现和自定义Syncfusion .NET MAUI Calendar控件的全面指南。SfCalendar提供了强大的日期选择功能,支持多种视图模式、丰富的自定义选项以及灵活的日期限制机制。
When to Use This Skill
何时使用该技能
Use this skill when you need to:
- Implement a calendar control in .NET MAUI applications
- Enable date selection (single date, multiple dates, or date ranges)
- Display calendar views (Month, Year, Decade, Century)
- Restrict date selection with min/max dates or custom validation
- Customize calendar appearance (backgrounds, text styles)
- Handle calendar events (selection changes, view changes, taps)
- Configure week numbers, first day of week, or trailing/leading dates
- Implement localization or RTL support for calendars
- Add special date highlighting or weekend styling
- Navigate programmatically between dates or views
当你需要以下功能时,可以使用本技能:
- 在.NET MAUI应用中实现日历控件
- 启用日期选择(单选、多选或范围选择)
- 显示日历视图(月视图、年视图、十年视图、世纪视图)
- 通过最小/最大日期或自定义验证来限制日期选择
- 自定义日历外观(背景、文本样式)
- 处理日历事件(选择变更、视图变更、点击)
- 配置周数、一周的第一天或前后导日期
- 实现日历的本地化或RTL(从右到左)支持
- 添加特殊日期高亮或周末样式
- 通过编程方式在日期或视图之间导航
Component Overview
组件概述
SfCalendar is a feature-rich calendar control that allows users to:
- Select single dates, multiple dates, or date ranges
- Navigate through Month, Year, Decade, and Century views
- Restrict dates using MinimumDate, MaximumDate, EnablePastDates, or SelectableDayPredicate
- Customize every aspect of the calendar's appearance
- Respond to user interactions through comprehensive events
Key Capabilities:
- 4 calendar views for flexible navigation
- 3 selection modes (Single, Multiple, Range)
- Comprehensive date restriction options
- Full customization (dates, today, trailing/leading)
- Rich event system for user interactions
- Localization and globalization support
- RTL (Right-to-Left) language support
SfCalendar是一个功能丰富的日历控件,允许用户:
- 选择单个日期、多个日期或日期范围
- 在月视图、年视图、十年视图和世纪视图之间导航
- 使用MinimumDate、MaximumDate、EnablePastDates或SelectableDayPredicate来限制日期
- 自定义日历外观的各个方面
- 通过全面的事件系统响应用户交互
核心功能:
- 4种日历视图,支持灵活导航
- 3种选择模式(单选、多选、范围选择)
- 全面的日期限制选项
- 完整的自定义能力(日期、今日、前后导日期)
- 丰富的用户交互事件系统
- 本地化和全球化支持
- RTL(从右到左)语言支持
Documentation and Navigation Guide
文档与导航指南
Getting Started
入门指南
📄 Read: references/getting-started.md
- Installation and NuGet package setup (Syncfusion.Maui.Calendar)
- Handler registration in MauiProgram.cs
- Basic SfCalendar initialization in XAML and C#
- First day of week customization
- Corner radius configuration
📄 阅读: references/getting-started.md
- 安装和NuGet包设置(Syncfusion.Maui.Calendar)
- 在MauiProgram.cs中注册处理器
- 在XAML和C#中初始化基础SfCalendar
- 自定义一周的第一天
- 配置圆角半径
Calendar Views
日历视图
📄 Read: references/calendar-views.md
- Month view (default, most common)
- Year view for month selection
- Decade view for year selection
- Century view for decade selection
- NumberOfVisibleWeeks property
- Week number display (ShowWeekNumber)
- View navigation and switching
📄 阅读: references/calendar-views.md
- 月视图(默认,最常用)
- 用于选择月份的年视图
- 用于选择年份的十年视图
- 用于选择十年范围的世纪视图
- NumberOfVisibleWeeks属性
- 周数显示(ShowWeekNumber)
- 视图导航与切换
Date Selection
日期选择
📄 Read: references/date-selection.md
- Single selection mode (one date at a time)
- Multiple selection mode (select multiple dates)
- Range selection mode (select date ranges)
- EnableSwipeSelection for range selection
- RangeSelectionDirection (Forward, Backward, Both, None)
- Programmatic selection with SelectedDate/SelectedDates/SelectedRange
- Selection behavior in different views
📄 阅读: references/date-selection.md
- 单选模式(一次选择一个日期)
- 多选模式(选择多个日期)
- 范围选择模式(选择日期范围)
- 范围选择的EnableSwipeSelection
- RangeSelectionDirection(Forward、Backward、Both、None)
- 使用SelectedDate/SelectedDates/SelectedRange进行编程式选择
- 不同视图中的选择行为
Date Restrictions
日期限制
📄 Read: references/date-restrictions.md
- MinimumDate property (restrict backward navigation)
- MaximumDate property (restrict forward navigation)
- EnablePastDates property (disable dates before today)
- SelectableDayPredicate (custom date validation logic)
- Disabling weekends or specific dates
- Date validation patterns
📄 阅读: references/date-restrictions.md
- MinimumDate属性(限制向后导航)
- MaximumDate属性(限制向前导航)
- EnablePastDates属性(禁用今日之前的日期)
- SelectableDayPredicate(自定义日期验证逻辑)
- 禁用周末或特定日期
- 日期验证模式
Date Navigation
日期导航
📄 Read: references/date-navigation.md
- DisplayDate property for programmatic navigation
- Programmatic view switching
- AllowViewNavigation property
- NavigateToAdjacentMonth (leading/trailing date navigation)
- Swipe gestures for month/year navigation
- Header tap navigation between views
📄 阅读: references/date-navigation.md
- 用于编程式导航的DisplayDate属性
- 编程式视图切换
- AllowViewNavigation属性
- NavigateToAdjacentMonth(前后导日期导航)
- 用于月/年导航的滑动手势
- 点击页眉在视图间导航
Calendar Modes and Display Options
日历模式与显示选项
📄 Read: references/calendar-modes.md
- Default mode (inline display)
- Dialog mode (centered popup)
- RelativeDialog mode (positioned popup)
- CalendarRelativePosition enum (AlignTop, AlignBottom, AlignToLeftOf, AlignToRightOf, etc.)
- IsOpen property for programmatic control
- PopupWidth and PopupHeight customization
- Date picker patterns
📄 阅读: references/calendar-modes.md
- 默认模式(内联显示)
- 对话框模式(居中弹窗)
- RelativeDialog模式(定位弹窗)
- CalendarRelativePosition枚举(AlignTop、AlignBottom、AlignToLeftOf、AlignToRightOf等)
- 用于编程控制的IsOpen属性
- 弹窗宽度和高度自定义
- 日期选择器模式
Customization and Styling
自定义与样式
📄 Read: references/customizations.md
- Month cell customization (dates, today, trailing/leading)
- Text styles (TextStyle, TodayTextStyle, DisabledDatesTextStyle)
- Background colors for all cell states
- Weekend date styling
- Special date highlighting with icons (Dot, Heart, Diamond, Star, Bell)
- Year, Decade, and Century view customization
- CalendarTextStyle properties (TextColor, FontSize, FontFamily)
📄 阅读: references/customizations.md
- 月单元格自定义(日期、今日、前后导日期)
- 文本样式(TextStyle、TodayTextStyle、DisabledDatesTextStyle)
- 所有单元格状态的背景颜色
- 周末日期样式
- 使用图标(Dot、Heart、Diamond、Star、Bell)高亮特殊日期
- 年视图、十年视图和世纪视图的自定义
- CalendarTextStyle属性(TextColor、FontSize、FontFamily)
Events and Interactions
事件与交互
📄 Read: references/events.md
- ViewChanged event (view/date range changes)
- SelectionChanged event (date selection changes)
- Tapped event (single tap on dates)
- DoubleTapped event (double tap on dates)
- LongPressed event (long press on dates)
- Event arguments and data
- Event handling patterns
📄 阅读: references/events.md
- ViewChanged事件(视图/日期范围变更)
- SelectionChanged事件(日期选择变更)
- Tapped事件(点击日期)
- DoubleTapped事件(双击日期)
- LongPressed事件(长按日期)
- 事件参数与数据
- 事件处理模式
Headers and Footers
页眉与页脚
📄 Read: references/headers-footers.md
- HeaderView customization (height, background, text style)
- Header text format customization
- ShowNavigationArrows property
- HeaderTemplate for custom header UI
- FooterView customization
- Custom footer templates
📄 阅读: references/headers-footers.md
- HeaderView自定义(高度、背景、文本样式)
- 页眉文本格式自定义
- ShowNavigationArrows属性
- 用于自定义页眉UI的HeaderTemplate
- FooterView自定义
- 自定义页脚模板
Localization and Advanced Features
本地化与高级功能
📄 Read: references/localization-advanced.md
- Globalization and localization setup
- CurrentUICulture configuration
- Resource file creation for multiple languages
- RTL (Right-to-Left) support
- CalendarIdentifier (Gregorian, Hijri, etc.)
- Calendar modes
- Liquid glass effect
- Advanced visual customization
📄 阅读: references/localization-advanced.md
- 全球化与本地化设置
- CurrentUICulture配置
- 为多语言创建资源文件
- RTL(从右到左)支持
- CalendarIdentifier(Gregorian、Hijri等)
- 日历模式
- 液态玻璃效果
- 高级视觉自定义