mcpField
S
syncfusion-wpf-datepicker

syncfusion-wpf-datepicker

github.com/syncfusionDevelopment5158 installsUpdated 1w ago
Repository

About syncfusion-wpf-datepicker

A reference skill for developers adding Syncfusion SfDatePicker to WPF applications. It covers date selection, formatting, range validation, interaction, and appearance settings.

Key features

  1. 01Date selection and change events
  2. 02Display and selector formatting
  3. 03Custom selector cells and sizing
  4. 04Minimum and maximum date limits
  5. 05Null values, watermark, and inline editing

Use cases

  1. 01Add date entry to WPF forms
  2. 02Restrict dates to an allowed range
  3. 03Format dates for different displays
  4. 04Provide inline editing and placeholder text

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/syncfusion/wpf-ui-components-skills --skill syncfusion-wpf-datepicker

After installing, type/syncfusion-wpf-datepickerin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
appearance-and-styling.md
date-formatting.md
date-selector-customization.md
features-and-interaction.md
getting-started.md
value-and-date-management.md

Details

From the project README

Implementing Syncfusion WPF DatePicker (SfDatePicker)

The SfDatePicker control allows users to select date values in a touch-friendly manner with a customizable dropdown date selector. This skill covers everything from basic setup to advanced customization and styling.

When to Use This Skill

  • Basic date selection – Add a DatePicker control to your WPF application
  • Date formatting – Display dates in various formats (short date, long date, month-only, etc.)
  • Customizing the date selector – Modify cell templates, sizes, and spacing of the dropdown selector
  • Styling and appearance – Change colors, backgrounds, themes, and flow direction (RTL support)
  • Managing date values – Set, validate, and restrict date ranges; handle date change events
  • Advanced interactions – Inline editing, watermarks, focus-based updates, keyboard input
  • User-friendly UX – Implement null values, watermark text, and on-screen keyboard support

Navigation Guide

Getting Started

📄 Read: references/getting-started.md

  • NuGet installation and assembly references
  • Adding the control via Designer, XAML, or C# code
  • Setting initial date values
  • Handling date change events (ValueChanged)
  • Basic setup and initialization
Date Formatting

📄 Read: references/date-formatting.md

  • Display formatting using FormatString property
  • Selector formatting using SelectorFormatString
  • Common format specifiers and examples
  • Date display in various formats
Date Selector Customization

📄 Read: references/date-selector-customization.md

  • Understanding SfDateSelector structure
  • Customizing cell templates (day, month, year)
  • Adjusting cell sizes and spacing
  • Style-based customization
  • Visual template examples
Appearance and Styling

📄 Read: references/appearance-and-styling.md

  • Changing foreground and background colors
  • Accent colors and selected item styling
  • Right-to-left (RTL) flow direction
  • Built-in themes (SfSkinManager, ThemeStudio)
  • Watermark text and templates
Value and Date Management

📄 Read: references/value-and-date-management.md

  • Setting date values programmatically
  • Handling null values
  • Watermark and placeholder text
  • Inline editing and keyboard input
  • Min/Max date range restrictions
  • Focus-based value updates
Features and Interaction

📄 Read: references/features-and-interaction.md

  • Inline editing mode
  • On-screen keyboard input scope
  • Date range validation
  • Localization support
  • Common workflows and best practices

Quick Start

Basic DatePicker in XAML
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
        Title="DatePicker Sample">
    <Grid>
        <syncfusion:SfDatePicker x:Name="sfDatePicker" 
                                 Width="200"
                                 Value="3/19/2026"/>
    </Grid>
</Window>
Basic DatePicker in C#
using Syncfusion.Windows.Controls.Input;

SfDatePicker sfDatePicker = new SfDatePicker();
sfDatePicker.Value = new DateTime(2026, 3, 19);
sfDatePicker.Width = 200;
this.Content = sfDatePicker;
Handle Date Selection
sfDatePicker.ValueChanged += (d, e) => 
{
    DateTime oldDate = (DateTime)e.OldValue;
    DateTime newDate = (DateTime)e.NewValue;
    Console.WriteLine($"Date changed from {oldDate:d} to {newDate:d}");
};

Common Patterns

Pattern 1: Set Date Format
<!-- Display as month only -->
<syncfusion:SfDatePicker FormatString="M" x:Name="sfDatePicker"/>
Pattern 2: Restrict Date Range
sfDatePicker.MinDate = new DateTime(2026, 1, 1);
sfDatePicker.MaxDate = new DateTime(2026, 12, 31);
Pattern 3: Allow Null with Watermark
<syncfusion:SfDatePicker AllowNull="True" 
                         Value="{x:Null}"
                         Watermark="Select a date"
                         x:Name="sfDatePicker"/>
Pattern 4: Inline Editing with Validation
<syncfusion:SfDatePicker AllowInlineEditing="True" 
                         InputScope="Number"
                         x:Name="sfDatePicker"/>
Pattern 5: Custom Styling with Colors
<syncfusion:SfDatePicker Foreground="Blue"
                         Background="LightGray"
                         AccentBrush="Green"
                         x:Name="sfDatePicker"/>

Key Properties Reference

PropertyTypeDefaultPurpose
ValueDateTime?Current dateSelected date
FormatStringstring"d"Display date format
SelectorFormatStringstring"M/d/yyyy"Dropdown selector format
AllowNullboolfalseAllow null values
WatermarkstringnullPlaceholder text
MinDateDateTimeMin valueEarliest selectable date
MaxDateDateTimeMax valueLatest selectable date
AllowInlineEditingboolfalseEnable inline date editing
ShowDropDownButtonbooltrueShow/hide dropdown button
DropDownHeightdoubleAutoHeight of dropdown popup
ForegroundBrushBlackText color
BackgroundBrushWhiteControl background
AccentBrushBrushBlueSelected item highlight

Comments

Markdown supported