menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class Calendar - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class Calendar

    Represents a control that enables a user to select a date by using a visual calendar display.

    Inheritance
    System.Object
    Calendar
    Implements
    System.IDisposable
    Namespace: Syncfusion.Windows.Controls
    Assembly: Syncfusion.Shared.Wpf.dll
    Syntax
    public class Calendar : Control, IDisposable

    Constructors

    Calendar()

    Initializes a new instance of the Calendar class.

    Declaration
    public Calendar()

    Fields

    AbbreviatedMonthNamesProperty

    Declaration
    public static readonly DependencyProperty AbbreviatedMonthNamesProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    CalendarButtonStyleProperty

    Identifies the CalendarButtonStyle dependency property.

    Declaration
    public static readonly DependencyProperty CalendarButtonStyleProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    CalendarDayButtonStyleProperty

    Identifies the DayButtonStyle dependency property.

    Declaration
    public static readonly DependencyProperty CalendarDayButtonStyleProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    CalendarItemStyleProperty

    Identifies the MonthStyle dependency property.

    Declaration
    public static readonly DependencyProperty CalendarItemStyleProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    CanBlockWeekEndsProperty

    Declaration
    public static readonly DependencyProperty CanBlockWeekEndsProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    CultureProperty

    Declaration
    public static readonly DependencyProperty CultureProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    DisableDateSelectionProperty

    Declaration
    public static readonly DependencyProperty DisableDateSelectionProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    DisplayDateEndProperty

    Identifies the DisplayDateEnd dependency property.

    Declaration
    public static readonly DependencyProperty DisplayDateEndProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    DisplayDateProperty

    Identifies the DisplayDate dependency property.

    Declaration
    public static readonly DependencyProperty DisplayDateProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    DisplayDateStartProperty

    Identifies the DisplayDateStart dependency property.

    Declaration
    public static readonly DependencyProperty DisplayDateStartProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    DisplayModeProperty

    Identifies the DisplayMode dependency property.

    Declaration
    public static readonly DependencyProperty DisplayModeProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    FirstDayOfWeekProperty

    Identifies the FirstDayOfWeek dependency property.

    Declaration
    public static readonly DependencyProperty FirstDayOfWeekProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    FormatCalendarProperty

    Declaration
    public static readonly DependencyProperty FormatCalendarProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    IsTodayHighlightedProperty

    Identifies the IsTodayHighlighted dependency property.

    Declaration
    public static readonly DependencyProperty IsTodayHighlightedProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    SelectedDateProperty

    Identifies the SelectedDate dependency property.

    Declaration
    public static readonly DependencyProperty SelectedDateProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    SelectedDatesChangedEvent

    Declaration
    public static readonly RoutedEvent SelectedDatesChangedEvent
    Field Value
    Type
    System.Windows.RoutedEvent

    SelectionModeProperty

    Identifies the SelectionMode dependency property.

    Declaration
    public static readonly DependencyProperty SelectionModeProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    ShortestDayNamesProperty

    Declaration
    public static readonly DependencyProperty ShortestDayNamesProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    Properties

    AbbreviatedMonthNames

    Get or Set AbbreviatedMonthNames for Calendar

    Declaration
    public string[] AbbreviatedMonthNames { get; set; }
    Property Value
    Type
    System.String[]

    BlackoutDates

    Gets or sets the dates that are not selectable.

    Declaration
    public CalendarBlackoutDatesCollection BlackoutDates { get; set; }
    Property Value
    Type
    CalendarBlackoutDatesCollection

    CalendarButtonStyle

    Gets or sets the style for displaying a CalendarButton.

    Declaration
    [Obsolete("This property is Deprecated, please use the Implicity style.")]
    public Style CalendarButtonStyle { get; set; }
    Property Value
    Type
    System.Windows.Style

    CalendarDayButtonStyle

    Gets or sets the style for displaying a day.

    Declaration
    [Obsolete("This property is Deprecated, please use the Implicity style.")]
    public Style CalendarDayButtonStyle { get; set; }
    Property Value
    Type
    System.Windows.Style

    CalendarItemStyle

    Gets or sets the style for a Month.

    Declaration
    [Obsolete("This property is Deprecated, please use the Implicity style.")]
    public Style CalendarItemStyle { get; set; }
    Property Value
    Type
    System.Windows.Style

    CanBlockWeekEnds

    Declaration
    public bool CanBlockWeekEnds { get; set; }
    Property Value
    Type
    System.Boolean

    Culture

    Setting Culture for calendar

    Declaration
    public CultureInfo Culture { get; set; }
    Property Value
    Type
    System.Globalization.CultureInfo

    DisableDateSelection

    Declaration
    public bool DisableDateSelection { get; set; }
    Property Value
    Type
    System.Boolean

    DisplayDate

    Gets or sets the date to display.

    Declaration
    public DateTime DisplayDate { get; set; }
    Property Value
    Type
    System.DateTime

    DisplayDateEnd

    Gets or sets the last date to be displayed.

    Declaration
    public DateTime? DisplayDateEnd { get; set; }
    Property Value
    Type
    System.Nullable<System.DateTime>

    DisplayDateStart

    Gets or sets the first date to be displayed.

    Declaration
    public DateTime? DisplayDateStart { get; set; }
    Property Value
    Type
    System.Nullable<System.DateTime>

    DisplayMode

    Gets or sets a value indicating whether the calendar is displayed in months or years.

    Declaration
    public CalendarMode DisplayMode { get; set; }
    Property Value
    Type
    CalendarMode

    FirstDayOfWeek

    Gets or sets the day that is considered the beginning of the week.

    Declaration
    public DayOfWeek FirstDayOfWeek { get; set; }
    Property Value
    Type
    System.DayOfWeek

    FormatCalendar

    Declaration
    public Calendar FormatCalendar { get; set; }
    Property Value
    Type
    System.Globalization.Calendar

    IsTodayHighlighted

    Gets or sets a value indicating whether the current date is highlighted.

    Declaration
    public bool IsTodayHighlighted { get; set; }
    Property Value
    Type
    System.Boolean

    SelectedDate

    Gets or sets the currently selected date.

    Declaration
    public DateTime? SelectedDate { get; set; }
    Property Value
    Type
    System.Nullable<System.DateTime>

    SelectedDates

    Gets the dates that are currently selected.

    Declaration
    public SelectedDatesCollection SelectedDates { get; }
    Property Value
    Type
    SelectedDatesCollection

    SelectionMode

    Gets or sets the selection mode for the calendar.

    Declaration
    public CalendarSelectionMode SelectionMode { get; set; }
    Property Value
    Type
    CalendarSelectionMode

    ShortestDayNames

    Get or Set ShortestDayNames for Calendar

    Declaration
    public string[] ShortestDayNames { get; set; }
    Property Value
    Type
    System.String[]

    Methods

    Dispose()

    Declaration
    public void Dispose()

    OnApplyTemplate()

    Invoked whenever application code or an internal process, such as a rebuilding layout pass, calls the ApplyTemplate method.

    Declaration
    public override void OnApplyTemplate()

    OnCreateAutomationPeer()

    Creates the automation peer for this Calendar Control.

    Declaration
    protected override AutomationPeer OnCreateAutomationPeer()
    Returns
    Type
    System.Windows.Automation.Peers.AutomationPeer

    OnDisableDateSelectionChanged(DependencyObject, DependencyPropertyChangedEventArgs)

    Declaration
    public static void OnDisableDateSelectionChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
    Parameters
    Type Name Description
    System.Windows.DependencyObject obj
    System.Windows.DependencyPropertyChangedEventArgs args

    OnDisableDateSelectionChanged(DependencyPropertyChangedEventArgs)

    Declaration
    protected void OnDisableDateSelectionChanged(DependencyPropertyChangedEventArgs args)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs args

    OnDisplayDateChanged(CalendarDateChangedEventArgs)

    Declaration
    protected virtual void OnDisplayDateChanged(CalendarDateChangedEventArgs e)
    Parameters
    Type Name Description
    CalendarDateChangedEventArgs e

    OnDisplayModeChanged(CalendarModeChangedEventArgs)

    Declaration
    protected virtual void OnDisplayModeChanged(CalendarModeChangedEventArgs e)
    Parameters
    Type Name Description
    CalendarModeChangedEventArgs e

    OnKeyDown(KeyEventArgs)

    Declaration
    protected override void OnKeyDown(KeyEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.KeyEventArgs e

    OnKeyUp(KeyEventArgs)

    Declaration
    protected override void OnKeyUp(KeyEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.KeyEventArgs e

    OnNewDateChanged(DependencyObject, DependencyPropertyChangedEventArgs)

    Declaration
    public static void OnNewDateChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
    Parameters
    Type Name Description
    System.Windows.DependencyObject obj
    System.Windows.DependencyPropertyChangedEventArgs args

    OnNewDateChanged(DependencyPropertyChangedEventArgs)

    Declaration
    protected void OnNewDateChanged(DependencyPropertyChangedEventArgs args)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs args

    OnPreviewMouseWheel(MouseWheelEventArgs)

    Invoked when an unhandled System.Windows.Input.Mouse.PreviewMouseWheel attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

    Declaration
    protected override void OnPreviewMouseWheel(MouseWheelEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.MouseWheelEventArgs e

    The System.Windows.Input.MouseWheelEventArgs that contains the event data.

    OnSelectedDateChanged(DependencyPropertyChangedEventArgs)

    Declaration
    protected void OnSelectedDateChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    OnSelectedDatesChanged(SelectionChangedEventArgs)

    Declaration
    protected virtual void OnSelectedDatesChanged(SelectionChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Controls.SelectionChangedEventArgs e

    OnSelectionModeChanged(EventArgs)

    Declaration
    protected virtual void OnSelectionModeChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    ShowNextCalendarPage()

    Declaration
    public void ShowNextCalendarPage()

    ShowPreviousCalendarPage()

    Declaration
    public void ShowPreviousCalendarPage()

    ToString()

    Provides a text representation of the selected date.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    A text representation of the selected date, or an empty string if SelectedDate is a null reference.

    Events

    DisableDateSelectionChanged

    Declaration
    public event PropertyChangedCallback DisableDateSelectionChanged
    Event Type
    Type
    System.Windows.PropertyChangedCallback

    DisplayDateChanged

    Occurs when the DisplayDate property is changed.

    Declaration
    public event EventHandler<CalendarDateChangedEventArgs> DisplayDateChanged
    Event Type
    Type
    System.EventHandler<CalendarDateChangedEventArgs>

    DisplayModeChanged

    Occurs when the DisplayMode property is changed.

    Declaration
    public event EventHandler<CalendarModeChangedEventArgs> DisplayModeChanged
    Event Type
    Type
    System.EventHandler<CalendarModeChangedEventArgs>

    MonthChanged

    Declaration
    public event RoutedEventHandler MonthChanged
    Event Type
    Type
    System.Windows.RoutedEventHandler

    NextCalendarPageChanged

    Declaration
    public event RoutedEventHandler NextCalendarPageChanged
    Event Type
    Type
    System.Windows.RoutedEventHandler

    PreviousCalendarPageChanged

    Declaration
    public event RoutedEventHandler PreviousCalendarPageChanged
    Event Type
    Type
    System.Windows.RoutedEventHandler

    SelectedDateChanged

    Declaration
    public event DependencyPropertyChangedEventHandler SelectedDateChanged
    Event Type
    Type
    System.Windows.DependencyPropertyChangedEventHandler

    SelectedDatesChanged

    Occurs when a date is selected.

    Declaration
    public event EventHandler<SelectionChangedEventArgs> SelectedDatesChanged
    Event Type
    Type
    System.EventHandler<System.Windows.Controls.SelectionChangedEventArgs>

    SelectionModeChanged

    Occurs when the SelectionMode property is changed.

    Declaration
    public event EventHandler<EventArgs> SelectionModeChanged
    Event Type
    Type
    System.EventHandler<System.EventArgs>

    Implements

    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved