syncfusion-winui-scheduler

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Implementing Syncfusion WinUI Scheduler (SfScheduler)

实现Syncfusion WinUI Scheduler (SfScheduler)

Comprehensive guide for implementing the Syncfusion® SfScheduler control in WinUI applications. SfScheduler provides a rich set of scheduling and calendar capabilities with 8+ view types, appointment management, resource grouping, and extensive customization options for managing schedules and events.
用于在WinUI应用中实现Syncfusion® SfScheduler控件的全面指南。SfScheduler提供了丰富的调度和日历能力,支持8种以上视图类型、预约管理、资源分组,以及用于管理日程和事件的大量自定义选项。

When to Use This Skill

何时使用本技能

Use this skill immediately when the user needs to:
  • Implement a calendar or scheduler component for WinUI applications
  • Create appointment booking or event management interfaces
  • Build meeting scheduling or time management tools
  • Display events in Day, Week, Month, or Timeline views
  • Handle appointment drag-and-drop or editing
  • Implement resource-based scheduling (rooms, employees, equipment)
  • Support recurring appointments or events
  • Manage time zones for appointments
  • Create calendar views with accessibility features
  • Build load-on-demand appointment loading for performance
当用户需要实现以下需求时,可直接使用本技能:
  • 为WinUI应用实现日历或调度组件
  • 创建预约预订或事件管理界面
  • 搭建会议调度或时间管理工具
  • 以日、周、月或时间线视图展示事件
  • 处理预约的拖拽或编辑功能
  • 实现基于资源的调度(会议室、员工、设备)
  • 支持重复预约或重复事件
  • 管理预约的时区
  • 创建支持无障碍功能的日历视图
  • 实现预约按需加载以提升性能

Scheduler Overview

Scheduler概述

The Syncfusion WinUI Scheduler (SfScheduler) is a comprehensive calendar and scheduling control that displays appointments in multiple view types and allows users to create, edit, and manage appointments efficiently.
**Syncfusion WinUI Scheduler (SfScheduler)**是一款功能全面的日历和调度控件,可在多种视图类型中展示预约,支持用户高效创建、编辑和管理预约。

Key Features

核心特性

  • 8 Built-in Views: Day, Week, WorkWeek, TimelineDay, TimelineWeek, TimelineWorkWeek, TimelineMonth, and Month
  • Appointment Management: Create, edit, delete appointments with built-in editor
  • Drag-and-Drop: Reschedule appointments via intuitive drag-and-drop
  • Recurring Events: Daily, weekly, monthly, yearly recurrence patterns with exceptions
  • Resource Grouping: Group appointments by resources (people, rooms, equipment)
  • Time Zone Support: Handle appointments across multiple time zones
  • Accessibility: Full keyboard navigation, screen reader support, WCAG compliance
  • Localization: Support for global date/time formats and cultures
  • Theming: Fluent Design System with Light, Dark, and HighContrast themes
  • Load-on-Demand: Performance optimization for large appointment datasets
  • Context Menu: Built-in and customizable context menus
  • Reminders: Appointment reminder notifications
  • 8种内置视图: 日、周、工作周、时间线日、时间线周、时间线工作周、时间线月、月
  • 预约管理: 内置编辑器支持创建、编辑、删除预约
  • 拖拽功能: 通过直观的拖拽操作重新安排预约
  • 重复事件: 支持日、周、月、年重复规则及例外情况
  • 资源分组: 按资源(人员、会议室、设备)分组展示预约
  • 时区支持: 处理跨多时区的预约
  • 无障碍能力: 全键盘导航、屏幕阅读器支持、符合WCAG标准
  • 本地化: 支持全球日期/时间格式和不同文化区域
  • 主题: 符合Fluent Design System,支持浅色、深色、高对比度主题
  • 按需加载: 针对大量预约数据集的性能优化
  • 上下文菜单: 内置可自定义的上下文菜单
  • 提醒: 预约提醒通知功能

Component Identity

组件标识

  • Package:
    Syncfusion.Scheduler.WinUI
  • Namespace:
    Syncfusion.UI.Xaml.Scheduler
  • Class:
    SfScheduler
  • 包:
    Syncfusion.Scheduler.WinUI
  • 命名空间:
    Syncfusion.UI.Xaml.Scheduler
  • 类:
    SfScheduler

Documentation and Navigation Guide

文档与导航指南

This section provides guidance on which reference file to read based on the user's needs. Each reference contains comprehensive documentation, code examples, and troubleshooting guidance.
本部分根据用户需求提供对应的参考文件指引,每份参考都包含全面的文档、代码示例和故障排查指南。

Getting Started

入门指南

📄 Read: references/getting-started.md
  • NuGet package installation and setup
  • Creating your first WinUI Scheduler application
  • Basic scheduler initialization in XAML and C#
  • Minimal working example with appointments
  • ViewType configuration (Day, Week, Month, etc.)
  • Setting the first day of the week
  • Namespace imports and basic structure
📄 阅读: references/getting-started.md
  • NuGet包安装与配置
  • 创建你的第一个WinUI Scheduler应用
  • 在XAML和C#中完成Scheduler基础初始化
  • 包含预约的最小可运行示例
  • ViewType配置(日、周、月等)
  • 设置一周的第一天
  • 命名空间导入和基础结构

Appointment Management

预约管理

Core Appointments

核心预约功能

📄 Read: references/appointments.md
  • Understanding ScheduleAppointment class and ScheduleAppointmentCollection
  • Creating schedule appointments with StartTime, EndTime, Subject
  • Adding appointments to the scheduler
  • Custom appointment mapping with AppointmentMapping property
  • Binding custom business objects to appointments
  • All-day appointments with IsAllDay property
  • Spanning appointments across multiple days
  • Appointment ordering and internal arrangement
  • Using ItemsSource for data binding
📄 阅读: references/appointments.md
  • 了解ScheduleAppointment类和ScheduleAppointmentCollection
  • 创建包含开始时间、结束时间、主题的日程预约
  • 向Scheduler中添加预约
  • 通过AppointmentMapping属性实现自定义预约映射
  • 将自定义业务对象绑定到预约
  • 通过IsAllDay属性设置全天预约
  • 支持跨多天的预约
  • 预约排序和内部排布
  • 使用ItemsSource进行数据绑定

Appointment Editing

预约编辑

📄 Read: references/appointment-editing.md
  • Built-in appointment editor dialog
  • Creating appointments through the UI
  • Editing existing appointments
  • Deleting appointments via editor
  • Customizing the editor dialog appearance
  • Validation rules for appointments
  • Handling editor events
  • Programmatic appointment editing
📄 阅读: references/appointment-editing.md
  • 内置的预约编辑对话框
  • 通过UI创建预约
  • 编辑现有预约
  • 通过编辑器删除预约
  • 自定义编辑对话框外观
  • 预约校验规则
  • 处理编辑器事件
  • 程序化编辑预约

Appointment Drag and Drop

预约拖拽

📄 Read: references/appointment-drag-drop.md
  • Enabling/disabling drag-and-drop functionality
  • Rescheduling appointments via drag
  • Drag-and-drop events (AppointmentDragStarting, AppointmentDragOver, AppointmentDrop)
  • Restricting drag-and-drop to specific views or time slots
  • Visual feedback during drag operations
  • Handling drag-drop validation
  • Preventing specific appointments from being dragged
📄 阅读: references/appointment-drag-drop.md
  • 启用/禁用拖拽功能
  • 通过拖拽重新安排预约
  • 拖拽相关事件(AppointmentDragStarting、AppointmentDragOver、AppointmentDrop)
  • 限制仅可在特定视图或时间段拖拽
  • 拖拽过程中的视觉反馈
  • 处理拖拽校验
  • 禁止特定预约被拖拽

View Types and Configuration

视图类型与配置

Day and Week Views

日与周视图

📄 Read: references/day-week-views.md
  • Day view configuration with ViewType.Day
  • Week view setup with ViewType.Week
  • WorkWeek view (Monday-Friday) with ViewType.WorkWeek
  • Customizing time intervals with TimeInterval property
  • Adjusting time slot height with TimeIntervalSize
  • Configuring flexible working days
  • Setting non-working days with NonWorkingDays property
  • Time ruler format customization
  • Start and end hour configuration
📄 阅读: references/day-week-views.md
  • 通过ViewType.Day配置日视图
  • 通过ViewType.Week配置周视图
  • 通过ViewType.WorkWeek配置工作周视图(周一至周五)
  • 通过TimeInterval属性自定义时间间隔
  • 通过TimeIntervalSize调整时间槽高度
  • 配置灵活的工作日设置
  • 通过NonWorkingDays属性设置非工作日
  • 时间标尺格式自定义
  • 开始与结束时间配置

Timeline Views

时间线视图

📄 Read: references/timeline-views.md
  • TimelineDay view for horizontal day display
  • TimelineWeek view for weekly timeline
  • TimelineWorkWeek view for workweek timeline
  • TimelineMonth view for monthly timeline
  • Customizing time intervals in timeline views
  • Adjusting time slot width with TimeIntervalSize
  • Horizontal scrolling behavior
  • Timeline-specific customization options
  • Flexible working days in timeline views
📄 阅读: references/timeline-views.md
  • 用于水平展示单日的TimelineDay视图
  • 展示周时间线的TimelineWeek视图
  • 展示工作周时间线的TimelineWorkWeek视图
  • 展示月时间线的TimelineMonth视图
  • 自定义时间线视图的时间间隔
  • 通过TimeIntervalSize调整时间槽宽度
  • 横向滚动行为
  • 时间线专属的自定义选项
  • 时间线视图的灵活工作日设置

Month View

月视图

📄 Read: references/month-view.md
  • Month view configuration with ViewType.Month
  • Agenda view integration
  • Configuring number of weeks displayed
  • Appointment indicators in month cells
  • Month cell appearance customization
  • Leading and trailing dates display
  • Month navigation patterns
  • Today date highlighting
📄 阅读: references/month-view.md
  • 通过ViewType.Month配置月视图
  • 议程视图集成
  • 配置展示的周数
  • 月单元格中的预约指示器
  • 月单元格外观自定义
  • 展示前后月份的日期
  • 月导航规则
  • 今日日期高亮

Navigation and Display

导航与展示

Date Navigation

日期导航

📄 Read: references/date-navigations.md
  • Navigating to specific dates programmatically
  • DisplayDate property for current visible date
  • Forward and backward navigation
  • ViewChanged event for tracking view changes
  • Handling date change events
  • Programmatic view switching
  • Date range validation
📄 阅读: references/date-navigations.md
  • 程序化导航到指定日期
  • 通过DisplayDate属性设置当前可见日期
  • 向前与向后导航
  • 通过ViewChanged事件跟踪视图变更
  • 处理日期变更事件
  • 程序化切换视图
  • 日期范围校验

Header Customization

头部自定义

📄 Read: references/header.md
  • Customizing scheduler header appearance
  • Date header format customization
  • Day header format configuration
  • Header template customization
  • Header height adjustment
  • Header text styling
  • View header patterns
📄 阅读: references/header.md
  • 自定义Scheduler头部外观
  • 日期头部格式自定义
  • 日期头部格式配置
  • 头部模板自定义
  • 头部高度调整
  • 头部文字样式
  • 视图头部规则

Resource Management

资源管理

Resource Grouping

资源分组

📄 Read: references/resource-grouping.md
  • Understanding resource concept (people, rooms, equipment)
  • Creating SchedulerResource objects with Id, Name, Foreground, Background
  • Adding resources to ResourceCollection
  • Assigning appointments to resources
  • ResourceGroupType.Resource for resource-based grouping
  • ResourceGroupType.Date for date-based grouping
  • Multiple resource support
  • Resource appearance customization
  • Sharing appointments across resources
📄 阅读: references/resource-grouping.md
  • 了解资源概念(人员、会议室、设备)
  • 创建包含Id、名称、前景色、背景色的SchedulerResource对象
  • 向ResourceCollection中添加资源
  • 为预约分配资源
  • 通过ResourceGroupType.Resource实现基于资源的分组
  • 通过ResourceGroupType.Date实现基于日期的分组
  • 多资源支持
  • 资源外观自定义
  • 跨资源共享预约

Events and Interactions

事件与交互

Scheduler Events

Scheduler事件

📄 Read: references/events.md
  • ViewChanged event for view type changes
  • CellTapped event for cell interactions
  • CellDoubleTapped event for double-tap handling
  • AppointmentTapped event for appointment selection
  • Setting up event handlers in XAML and code
  • Event argument properties and data
  • Handling user interactions
📄 阅读: references/events.md
  • 用于视图类型变更的ViewChanged事件
  • 用于单元格交互的CellTapped事件
  • 用于处理双击的CellDoubleTapped事件
  • 用于预约选中的AppointmentTapped事件
  • 在XAML和代码中设置事件处理函数
  • 事件参数属性和数据
  • 处理用户交互

Context Menu and Commands

上下文菜单与命令

📄 Read: references/context-flyout-commands.md
  • Built-in context menu functionality
  • Adding custom context menu items
  • Context menu commands
  • Handling context menu events
  • Customizing menu appearance
  • Command patterns for actions
📄 阅读: references/context-flyout-commands.md
  • 内置上下文菜单功能
  • 添加自定义上下文菜单项
  • 上下文菜单命令
  • 处理上下文菜单事件
  • 自定义菜单外观
  • 操作的命令模式

Advanced Features

高级特性

Time Zone Support

时区支持

📄 Read: references/time-zone.md
  • Setting scheduler TimeZone property
  • Appointment-specific time zones with StartTimeZone and EndTimeZone
  • Display time zone configuration
  • Handling daylight savings time
  • Converting appointments across time zones
  • Time zone display in UI
  • Best practices for multi-timezone applications
📄 阅读: references/time-zone.md
  • 设置Scheduler的TimeZone属性
  • 通过StartTimeZone和EndTimeZone为单个预约设置时区
  • 展示时区配置
  • 处理夏令时
  • 跨时区转换预约
  • UI中的时区展示
  • 多时区应用最佳实践

Load-on-Demand

按需加载

📄 Read: references/load-on-demand.md
  • Enabling load-on-demand for performance
  • QueryAppointments event for dynamic loading
  • Loading indicator display
  • Handling large appointment datasets efficiently
  • Date range-based loading
  • Performance optimization techniques
  • Lazy loading patterns
📄 阅读: references/load-on-demand.md
  • 启用按需加载提升性能
  • 通过QueryAppointments事件实现动态加载
  • 加载指示器展示
  • 高效处理大量预约数据集
  • 基于日期范围的加载
  • 性能优化技巧
  • 懒加载模式

Reminders

提醒

📄 Read: references/reminder.md
  • Configuring appointment reminders
  • Reminder alert functionality
  • Reminder window customization
  • Snooze functionality
  • Custom reminder intervals
  • Reminder notifications
📄 阅读: references/reminder.md
  • 配置预约提醒
  • 提醒弹窗功能
  • 提醒窗口自定义
  • 延后提醒功能
  • 自定义提醒间隔
  • 提醒通知

Accessibility and Localization

无障碍与本地化

Accessibility

无障碍

📄 Read: references/accessibility.md
  • Keyboard navigation (Tab, Arrow keys, Enter, Escape)
  • Screen reader support (Narrator compatibility)
  • WCAG 2.1 compliance
  • Focus indicators and visual feedback
  • Accessible appointment creation and editing
  • High contrast theme support
  • Accessibility best practices
📄 阅读: references/accessibility.md
  • 键盘导航(Tab、方向键、Enter、Escape)
  • 屏幕阅读器支持(兼容Narrator)
  • 符合WCAG 2.1标准
  • 焦点指示器和视觉反馈
  • 可无障碍访问的预约创建和编辑
  • 高对比度主题支持
  • 无障碍最佳实践

Localization

本地化

📄 Read: references/localization.md
  • Setting up localization for scheduler
  • Creating resource files (.resw) for cultures
  • Culture-specific date and time formatting
  • Localizing scheduler UI strings
  • RTL (Right-to-Left) language support
  • Multiple language support patterns
📄 阅读: references/localization.md
  • 为Scheduler配置本地化
  • 创建对应文化区域的资源文件(.resw)
  • 文化区域专属的日期和时间格式化
  • 本地化Scheduler UI字符串
  • 支持RTL(从右到左)语言
  • 多语言支持模式

Customization and Theming

自定义与主题

Themes

主题

📄 Read: references/themes.md
  • Built-in Fluent Design themes (Light, Dark, HighContrast)
  • Applying themes to scheduler
  • Custom theme creation
  • Color customization with ThemeResource
  • Overriding theme keys
  • Theme resource files on GitHub
  • Responsive theme switching
📄 阅读: references/themes.md
  • 内置Fluent Design主题(浅色、深色、高对比度)
  • 为Scheduler应用主题
  • 自定义主题创建
  • 通过ThemeResource自定义颜色
  • 覆盖主题键
  • GitHub上的主题资源文件
  • 响应式主题切换

Quick Start Example

快速入门示例

Here's a minimal example to get started with the WinUI Scheduler:
以下是WinUI Scheduler的最小可运行示例:

XAML Setup

XAML配置

xml
<Window
    x:Class="SchedulerApp.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:scheduler="using:Syncfusion.UI.Xaml.Scheduler">
    
    <Grid>
        <scheduler:SfScheduler x:Name="Schedule" 
                              ViewType="Week" 
                              FirstDayOfWeek="Monday" />
    </Grid>
</Window>
xml
<Window
    x:Class="SchedulerApp.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:scheduler="using:Syncfusion.UI.Xaml.Scheduler">
    
    <Grid>
        <scheduler:SfScheduler x:Name="Schedule" 
                              ViewType="Week" 
                              FirstDayOfWeek="Monday" />
    </Grid>
</Window>

C# Code-Behind

C#代码后置

csharp
using Syncfusion.UI.Xaml.Scheduler;
using System;

namespace SchedulerApp
{
    public sealed partial class MainWindow : Window
    {
        public MainWindow()
        {
            this.InitializeComponent();
            
            // Create appointment collection
            var appointments = new ScheduleAppointmentCollection();
            
            // Add a sample appointment
            appointments.Add(new ScheduleAppointment
            {
                StartTime = DateTime.Now.Date.AddHours(10),
                EndTime = DateTime.Now.Date.AddHours(12),
                Subject = "Team Meeting",
                Location = "Conference Room A",
                Notes = "Discuss Q1 goals"
            });
            
            // Set appointments to scheduler
            Schedule.ItemsSource = appointments;
        }
    }
}
csharp
using Syncfusion.UI.Xaml.Scheduler;
using System;

namespace SchedulerApp
{
    public sealed partial class MainWindow : Window
    {
        public MainWindow()
        {
            this.InitializeComponent();
            
            // 创建预约集合
            var appointments = new ScheduleAppointmentCollection();
            
            // 添加示例预约
            appointments.Add(new ScheduleAppointment
            {
                StartTime = DateTime.Now.Date.AddHours(10),
                EndTime = DateTime.Now.Date.AddHours(12),
                Subject = "Team Meeting",
                Location = "Conference Room A",
                Notes = "Discuss Q1 goals"
            });
            
            // 为Scheduler设置预约数据
            Schedule.ItemsSource = appointments;
        }
    }
}

Result

效果

This creates a Week view scheduler with one appointment scheduled from 10 AM to 12 PM today.
以上代码会创建一个周视图的Scheduler,包含一个今日10:00到12:00的预约。

Common Patterns

常用模式

Pattern 1: Custom Appointment Binding

模式1:自定义预约绑定

When working with custom business objects instead of
ScheduleAppointment
:
csharp
// Custom appointment class
public class Meeting
{
    public string Title { get; set; }
    public DateTime From { get; set; }
    public DateTime To { get; set; }
    public bool AllDay { get; set; }
}
xml
<scheduler:SfScheduler x:Name="Schedule" 
                      ItemsSource="{Binding Meetings}">
    <scheduler:SfScheduler.AppointmentMapping>
        <scheduler:AppointmentMapping
            Subject="Title"
            StartTime="From"
            EndTime="To"
            IsAllDay="AllDay"/>
    </scheduler:SfScheduler.AppointmentMapping>
</scheduler:SfScheduler>
当你使用自定义业务对象而非
ScheduleAppointment
时:
csharp
// 自定义预约类
public class Meeting
{
    public string Title { get; set; }
    public DateTime From { get; set; }
    public DateTime To { get; set; }
    public bool AllDay { get; set; }
}
xml
<scheduler:SfScheduler x:Name="Schedule" 
                      ItemsSource="{Binding Meetings}">
    <scheduler:SfScheduler.AppointmentMapping>
        <scheduler:AppointmentMapping
            Subject="Title"
            StartTime="From"
            EndTime="To"
            IsAllDay="AllDay"/>
    </scheduler:SfScheduler.AppointmentMapping>
</scheduler:SfScheduler>

Pattern 2: Recurring Appointments

模式2:重复预约

csharp
var recurringAppointment = new ScheduleAppointment
{
    StartTime = DateTime.Now.Date.AddHours(9),
    EndTime = DateTime.Now.Date.AddHours(10),
    Subject = "Daily Standup",
    RecurrenceRule = "FREQ=DAILY;INTERVAL=1;COUNT=10"
};
csharp
var recurringAppointment = new ScheduleAppointment
{
    StartTime = DateTime.Now.Date.AddHours(9),
    EndTime = DateTime.Now.Date.AddHours(10),
    Subject = "Daily Standup",
    RecurrenceRule = "FREQ=DAILY;INTERVAL=1;COUNT=10"
};

Pattern 3: Resource-Based Scheduling

模式3:基于资源的调度

csharp
// Create resources
var resources = new ObservableCollection<SchedulerResource>
{
    new SchedulerResource 
    { 
        Id = "1", 
        Name = "Conference Room A",
        Background = new SolidColorBrush(Colors.Blue)
    },
    new SchedulerResource 
    { 
        Id = "2", 
        Name = "Conference Room B",
        Background = new SolidColorBrush(Colors.Green)
    }
};

Schedule.ResourceCollection = resources;
Schedule.ResourceGroupType = ResourceGroupType.Resource;

// Assign appointment to resource
var appointment = new ScheduleAppointment
{
    StartTime = DateTime.Now.Date.AddHours(10),
    EndTime = DateTime.Now.Date.AddHours(11),
    Subject = "Product Demo",
    ResourceIdCollection = new ObservableCollection<object> { "1" }
};
csharp
// 创建资源
var resources = new ObservableCollection<SchedulerResource>
{
    new SchedulerResource 
    { 
        Id = "1", 
        Name = "Conference Room A",
        Background = new SolidColorBrush(Colors.Blue)
    },
    new SchedulerResource 
    { 
        Id = "2", 
        Name = "Conference Room B",
        Background = new SolidColorBrush(Colors.Green)
    }
};

Schedule.ResourceCollection = resources;
Schedule.ResourceGroupType = ResourceGroupType.Resource;

// 为预约分配资源
var appointment = new ScheduleAppointment
{
    StartTime = DateTime.Now.Date.AddHours(10),
    EndTime = DateTime.Now.Date.AddHours(11),
    Subject = "Product Demo",
    ResourceIdCollection = new ObservableCollection<object> { "1" }
};

Pattern 4: View Type Switching

模式4:视图类型切换

csharp
// Switch between views programmatically
public void SwitchToMonthView()
{
    Schedule.ViewType = SchedulerViewType.Month;
}

public void SwitchToTimelineView()
{
    Schedule.ViewType = SchedulerViewType.TimelineWeek;
}
csharp
// 程序化切换视图
public void SwitchToMonthView()
{
    Schedule.ViewType = SchedulerViewType.Month;
}

public void SwitchToTimelineView()
{
    Schedule.ViewType = SchedulerViewType.TimelineWeek;
}

Pattern 5: Time Zone Handling

模式5:时区处理

csharp
// Set scheduler time zone
Schedule.TimeZone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");

// Appointment with specific time zones
var appointment = new ScheduleAppointment
{
    StartTime = new DateTime(2024, 3, 22, 10, 0, 0),
    EndTime = new DateTime(2024, 3, 22, 11, 0, 0),
    Subject = "Cross-timezone Meeting",
    StartTimeZone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"),
    EndTimeZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time")
};
csharp
// 设置Scheduler时区
Schedule.TimeZone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");

// 设置了专属时区的预约
var appointment = new ScheduleAppointment
{
    StartTime = new DateTime(2024, 3, 22, 10, 0, 0),
    EndTime = new DateTime(2024, 3, 22, 11, 0, 0),
    Subject = "Cross-timezone Meeting",
    StartTimeZone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"),
    EndTimeZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time")
};

Key Properties Reference

核心属性参考

Essential Properties

基础属性

PropertyTypeDescription
ViewType
SchedulerViewType
Sets the view type (Day, Week, Month, Timeline variants)
ItemsSource
IEnumerable
Data source for appointments
DisplayDate
DateTime
Currently displayed date in scheduler
FirstDayOfWeek
DayOfWeek
First day of the week (Sunday, Monday, etc.)
TimeZone
TimeZoneInfo
Time zone for displaying appointments
属性类型描述
ViewType
SchedulerViewType
设置视图类型(日、周、月、时间线变体)
ItemsSource
IEnumerable
预约的数据源
DisplayDate
DateTime
Scheduler当前展示的日期
FirstDayOfWeek
DayOfWeek
一周的第一天(周日、周一等)
TimeZone
TimeZoneInfo
展示预约使用的时区

Appearance Properties

外观属性

PropertyTypeDescription
DaysViewSettings
DaysViewSettings
Settings for Day/Week/WorkWeek views
TimelineViewSettings
TimelineViewSettings
Settings for Timeline views
MonthViewSettings
MonthViewSettings
Settings for Month view
属性类型描述
DaysViewSettings
DaysViewSettings
日/周/工作周视图的配置
TimelineViewSettings
TimelineViewSettings
时间线视图的配置
MonthViewSettings
MonthViewSettings
月视图的配置

Resource Properties

资源属性

PropertyTypeDescription
ResourceCollection
ObservableCollection<SchedulerResource>
Collection of resources
ResourceGroupType
ResourceGroupType
Grouping type (None, Resource, Date)
属性类型描述
ResourceCollection
ObservableCollection<SchedulerResource>
资源集合
ResourceGroupType
ResourceGroupType
分组类型(无、资源、日期)

Appointment Mapping

预约映射

PropertyTypeDescription
AppointmentMapping
AppointmentMapping
Maps custom object properties to appointment properties
属性类型描述
AppointmentMapping
AppointmentMapping
将自定义对象的属性映射到预约属性

View-Specific Settings

视图专属配置

DaysViewSettings:
  • TimeInterval
    - Time slot interval (e.g., 30 minutes, 1 hour)
  • TimeIntervalSize
    - Height of time slots
  • NonWorkingDays
    - Days to mark as non-working
TimelineViewSettings:
  • TimeInterval
    - Time slot interval for timeline
  • TimeIntervalSize
    - Width of time slots in timeline
MonthViewSettings:
  • NumberOfWeeksInView
    - Number of weeks to display
  • ShowAgendaView
    - Show/hide agenda view
DaysViewSettings:
  • TimeInterval
    - 时间槽间隔(例如30分钟、1小时)
  • TimeIntervalSize
    - 时间槽高度
  • NonWorkingDays
    - 标记为非工作日的日期
TimelineViewSettings:
  • TimeInterval
    - 时间线的时间槽间隔
  • TimeIntervalSize
    - 时间线中时间槽的宽度
MonthViewSettings:
  • NumberOfWeeksInView
    - 展示的周数
  • ShowAgendaView
    - 显示/隐藏议程视图

Common Use Cases

常见使用场景

1. Meeting Room Booking System

1. 会议室预订系统

Create a resource-based scheduler showing conference room availability with drag-drop booking.
When to use: Building room reservation systems, equipment scheduling Key features: Resource grouping, drag-drop, appointment editing
创建基于资源的Scheduler,展示会议室可用状态,支持拖拽预订。
适用场景: 搭建会议室预订系统、设备调度系统 核心特性: 资源分组、拖拽、预约编辑

2. Employee Shift Scheduler

2. 员工排班调度器

Display employee shifts across multiple days with color-coded schedules.
When to use: Shift planning, workforce management, retail scheduling Key features: Resource grouping, Week/Month views, custom appointment colors
跨多日展示员工排班,支持颜色编码的日程展示。
适用场景: 排班规划、人力管理、零售调度 核心特性: 资源分组、周/月视图、自定义预约颜色

3. Doctor Appointment System

3. 医生预约系统

Manage patient appointments with time slots and recurring appointments.
When to use: Healthcare scheduling, appointment booking systems Key features: Day/Week views, recurring appointments, appointment editing
管理患者预约,支持时间段配置和重复预约。
适用场景: 医疗调度、预约预订系统 核心特性: 日/周视图、重复预约、预约编辑

4. Event Calendar

4. 活动日历

Display events in a monthly calendar view with event details.
When to use: Event management, conference scheduling, activity calendars Key features: Month view, all-day events, custom appointment templates
在月视图中展示活动及活动详情。
适用场景: 活动管理、会议调度、活动日历 核心特性: 月视图、全天事件、自定义预约模板

5. Project Timeline

5. 项目时间线

Show project milestones and tasks in a timeline view.
When to use: Project management, Gantt-like views, planning tools Key features: Timeline views, spanning appointments, resource grouping
在时间线视图中展示项目里程碑和任务。
适用场景: 项目管理、类甘特图视图、规划工具 核心特性: 时间线视图、跨天预约、资源分组

6. Multi-Timezone Scheduler

6. 多时区调度器

Handle appointments across different time zones for global teams.
When to use: Remote team coordination, international scheduling Key features: Time zone support, time zone conversion, time display
Best practices:
  • Use load-on-demand for large appointment datasets (>1000 appointments)
  • Bind to
    ObservableCollection
    for automatic UI updates
  • Implement
    INotifyPropertyChanged
    in custom appointment classes
  • Use
    AppointmentMapping
    for custom business objects
  • Provide clear visual feedback during drag-drop operations
  • Use meaningful colors for different appointment types or resources
  • Enable keyboard navigation for accessibility
  • Use theme resources for consistent appearance
  • Validate appointment overlaps if required by business logic
  • Handle time zone conversions carefully
为全球团队处理跨时区的预约。
适用场景: 远程团队协作、国际调度 核心特性: 时区支持、时区转换、时间展示
最佳实践:
  • 针对大量预约数据集(超过1000条)使用按需加载
  • 绑定到
    ObservableCollection
    实现UI自动更新
  • 在自定义预约类中实现
    INotifyPropertyChanged
    接口
  • 使用
    AppointmentMapping
    适配自定义业务对象
  • 拖拽操作过程中提供清晰的视觉反馈
  • 为不同类型的预约或资源设置有辨识度的颜色
  • 启用键盘导航提升无障碍能力
  • 使用主题资源保证外观一致性
  • 如有业务需求可实现预约重叠校验
  • 谨慎处理时区转换逻辑

Troubleshooting

故障排查

Appointments Not Showing

预约不展示

  • Verify
    ItemsSource
    is properly bound
  • Check that
    StartTime
    and
    EndTime
    are within visible date range
  • Ensure
    ViewType
    is set correctly
  • Confirm appointments are added to the collection
  • 确认
    ItemsSource
    已正确绑定
  • 检查
    StartTime
    EndTime
    是否在可见日期范围内
  • 确认
    ViewType
    已正确设置
  • 确认预约已添加到集合中

Drag-Drop Not Working

拖拽功能不生效

  • Check that appointments are not read-only
  • Verify drag-drop is enabled (default is enabled)
  • Ensure target time slot is valid for the appointment
  • 检查预约不是只读状态
  • 确认拖拽功能已启用(默认启用)
  • 确认目标时间槽对该预约有效

Resource Grouping Not Visible

资源分组不展示

  • Verify
    ResourceGroupType
    is not set to
    None
  • Check that
    ResourceCollection
    is populated
  • Ensure appointments have correct
    ResourceIdCollection
    values
  • 确认
    ResourceGroupType
    未设置为
    None
  • 检查
    ResourceCollection
    已填充数据
  • 确认预约的
    ResourceIdCollection
    值正确

Performance Issues

性能问题

  • Implement load-on-demand for large datasets
  • Reduce the number of simultaneously visible appointments
  • Optimize custom templates if used
  • 针对大数据集实现按需加载
  • 减少同时可见的预约数量
  • 如使用自定义模板可进行优化

Next Steps

后续步骤

Based on the user's specific needs, guide them to the appropriate reference file from the Documentation and Navigation Guide section above. Each reference provides in-depth coverage with code examples, edge cases, and troubleshooting.
For general questions about WinUI components or other Syncfusion controls, refer to the parent skill:
  • Implementing Syncfusion WinUI Components

NuGet Package:
Syncfusion.Scheduler.WinUI

Namespace:
Syncfusion.UI.Xaml.Scheduler

API Reference: https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.html
根据用户的具体需求,引导他们阅读上文文档与导航指南部分对应的参考文件,每份参考都提供了深度讲解、代码示例、边界场景处理和故障排查方案。
如需了解WinUI组件或其他Syncfusion控件的通用问题,可参考父技能:
  • 实现Syncfusion WinUI组件

NuGet包:
Syncfusion.Scheduler.WinUI

命名空间:
Syncfusion.UI.Xaml.Scheduler

API参考: https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.html