Interface ICalendar
A .NET WPF calendar or a date picker object.
public interface ICalendar : IUiObjectBase, IUiObjectBase, IClickable, IDoubleClickable, ILocationInfoProvider, ISupportSendKeys, ISupportDragAndDrop, IEnabledProvider, IVisibleProvider, ISupportsNativeObject, ITestObject, ITestObjectDescriber
- Inherited Members
- Extension Methods
Properties
Date
Either the date or the start date of the date range associated with this object. Note:
DateTime Date { get; }
Property Value
Remarks
- In case a date range is selected, the Date property will return the start date of the range.
- If you try to retrieve a date value from a WPF calendar object (e.g. calendar.Date; calendar.Date.Month; calendar.Date.Year) before performing an operation on it, an exception of type: InvalidOperationException is returned. Therefore, make sure to precede the retrieve value step with a step that performs an operation on the calendar, such as using SetDate(DateTime) to set the date on the calendar to the current date.
DateRanges
The selected date range of this Month Calendar control in multi-selection mode.
DateRange[] DateRanges { get; }
Property Value
Remarks
If a single date is selected in the calendar:
- DateRanges returns an array with a single element.
- Both DateRange.StartDate and DateRange.EndDate are equal to the selected date.
HelpText
The help text associated with this object.
string HelpText { get; }
Property Value
ParentText
The text associated with the parent object of this object.
string ParentText { get; }
Property Value
Methods
GetDateFormatType()
Returns the date format type.
DateFormatType GetDateFormatType()
Returns
SetDate(DateTime)
Sets the date of a WPF calendar or of a date picker.
void SetDate(DateTime date)
Parameters
dateDateTimeThe date to set.
SetDateRange(DateRange)
Sets the date range of a WPF calendar or the date of a date picker.
void SetDateRange(DateRange dateRange)
Parameters
dateRangeDateRangeThe date range to set.
SetDateRange(DateTime, DateTime)
Sets the date range of a WPF calendar or the date of a date picker.
void SetDateRange(DateTime startDate, DateTime endDate)
Parameters
SetDateRanges(params DateRange[])
Sets the date ranges of a WPF calendar or the date of a date picker.
void SetDateRanges(params DateRange[] dateRanges)
Parameters
dateRangesDateRange[]The date ranges to set.
SetMonth(int)
Sets the month in a WPF calendar.
void SetMonth(int month)
Parameters
monthintA number from 1 to 12.
SetYear(int)
Sets the year in a WPF calendar.
void SetYear(int year)
Parameters
yearintThe year to be set for the calendar.