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
Assembly: Syncfusion.Shared.Wpf.dll
Syntax
public class Calendar : Control, IDisposable
Constructors
Calendar()
Initializes a new instance of the Calendar class.
Declaration
Fields
AbbreviatedMonthNamesProperty
Declaration
public static readonly DependencyProperty AbbreviatedMonthNamesProperty
Field Value
Type |
System.Windows.DependencyProperty |
Identifies the CalendarButtonStyle dependency property.
Declaration
public static readonly DependencyProperty CalendarButtonStyleProperty
Field Value
Type |
System.Windows.DependencyProperty |
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 |
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
BlackoutDates
Gets or sets the dates that are not selectable.
Declaration
public CalendarBlackoutDatesCollection BlackoutDates { get; set; }
Property Value
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 |
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
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
DisplayDate
Gets or sets the date to display.
Declaration
public DateTime DisplayDate { get; set; }
Property Value
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
FirstDayOfWeek
Gets or sets the day that is considered the beginning of the week.
Declaration
public DayOfWeek FirstDayOfWeek { get; set; }
Property Value
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
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
SelectionMode
Gets or sets the selection mode for the calendar.
Declaration
public CalendarSelectionMode SelectionMode { get; set; }
Property Value
ShortestDayNames
Get or Set ShortestDayNames for Calendar
Declaration
public string[] ShortestDayNames { get; set; }
Property Value
Methods
Dispose()
Declaration
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
OnDisplayModeChanged(CalendarModeChangedEventArgs)
Declaration
protected virtual void OnDisplayModeChanged(CalendarModeChangedEventArgs e)
Parameters
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type |
Name |
Description |
System.Windows.Input.KeyEventArgs |
e |
|
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 |
|
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
DisplayModeChanged
Occurs when the DisplayMode property is changed.
Declaration
public event EventHandler<CalendarModeChangedEventArgs> DisplayModeChanged
Event Type
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