Loading...
Loading...
Guide to using the Syncfusion WPF CalendarEdit control for date selection and navigation. Use this skill whenever the user needs to implement calendar functionality, select dates, restrict date ranges, customize calendar appearance, or work with multi-date selection. Essential for building date picker interfaces, booking systems, scheduling applications, and any WPF project requiring calendar controls.
npx skill4agent add syncfusion/wpf-ui-components-skills syncfusion-wpf-calendar<Window x:Class="CalendarDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
Title="Calendar Demo" Height="450" Width="500">
<Grid>
<!-- Basic calendar control -->
<syncfusion:CalendarEdit Name="calendarEdit"
Height="250"
Width="300"
VerticalAlignment="Center"
HorizontalAlignment="Center"/>
</Grid>
</Window>using Syncfusion.Windows.Shared;
CalendarEdit calendarEdit = new CalendarEdit();
calendarEdit.Height = 250;
calendarEdit.Width = 300;
// Get selected date
DateTime selectedDate = calendarEdit.Date;
// Set selected date programmatically
calendarEdit.Date = new DateTime(2024, 3, 15);// Allow only dates in March 2024
calendarEdit.MinDate = new DateTime(2024, 3, 1);
calendarEdit.MaxDate = new DateTime(2024, 3, 31);
calendarEdit.Date = new DateTime(2024, 3, 15);
// Get the selected date
DateTime selectedDate = calendarEdit.Date;// Enable multiple date selection
calendarEdit.AllowMultiplySelection = true;
// Select multiple dates by dragging or Ctrl+clicking
// Retrieve all selected dates
var selectedDates = calendarEdit.SelectedDates;// Block specific date ranges
calendarEdit.BlackoutDates.Add(new DateTime(2024, 3, 5));
calendarEdit.BlackoutDates.Add(new DateTime(2024, 3, 20));
// Users cannot select these dates
calendarEdit.Date = new DateTime(2024, 3, 15);using System.Windows.Media;
// Customize colors
calendarEdit.Foreground = Brushes.Blue;
calendarEdit.Background = Brushes.White;
calendarEdit.MouseOverForeground = Brushes.Red;
calendarEdit.MouseOverBackground = Brushes.Lavender;
// Customize header
calendarEdit.HeaderBackground = Brushes.Green;
calendarEdit.HeaderForeground = Brushes.Yellow;| Property | Type | Description |
|---|---|---|
| DateTime | Gets or sets the currently selected date |
| Collection | Gets all selected dates in multi-selection mode |
| bool | Enables or disables multiple date selection |
| DateTime | Sets the earliest selectable date |
| DateTime | Sets the latest selectable date |
| Collection | Contains dates that cannot be selected |
| bool | Disables date selection (month/year still selectable) |
| bool | Hides dates outside MinDate/MaxDate range |
| Brush | Customizes the header background color |
| Brush | Customizes the header text color |
| int | Animation duration for mode changes (ms) |
| int | Animation duration for month transitions (ms) |