Interface ICalendar
A .NET WPF calendar or a date picker object.
Inherited Members
Namespace: HP.LFT.SDK.WPF
Assembly: HP.LFT.SDK.dll
Syntax
public interface ICalendar : IUiObjectBase, IUiObjectBase, IClickable, IDoubleClickable, ILocationInfoProvider, ISupportSendKeys, ISupportDragAndDrop, IEnabledProvider, IVisibleProvider, ISupportsNativeObject, ITestObject, ITestObjectDescriber
Properties
Date
Either the date or the start date of the date range associated with this object. Note:
Declaration
DateTime Date { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
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.
Declaration
DateRange[] DateRanges { get; }
Property Value
| Type | Description |
|---|---|
| DateRange[] |
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.
Declaration
string HelpText { get; }
Property Value
| Type | Description |
|---|---|
| string |
ParentText
The text associated with the parent object of this object.
Declaration
string ParentText { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
GetDateFormatType()
Returns the date format type.
Declaration
DateFormatType GetDateFormatType()
Returns
| Type | Description |
|---|---|
| DateFormatType |
SetDate(DateTime)
Sets the date of a WPF calendar or of a date picker.
Declaration
void SetDate(DateTime date)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | date | The date to set. |
SetDateRange(DateRange)
Sets the date range of a WPF calendar or the date of a date picker.
Declaration
void SetDateRange(DateRange dateRange)
Parameters
| Type | Name | Description |
|---|---|---|
| DateRange | dateRange | The date range to set. |
SetDateRange(DateTime, DateTime)
Sets the date range of a WPF calendar or the date of a date picker.
Declaration
void SetDateRange(DateTime startDate, DateTime endDate)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | startDate | The start date of the range. |
| DateTime | endDate | The end date of the range. |
SetDateRanges(params DateRange[])
Sets the date ranges of a WPF calendar or the date of a date picker.
Declaration
void SetDateRanges(params DateRange[] dateRanges)
Parameters
| Type | Name | Description |
|---|---|---|
| DateRange[] | dateRanges | The date ranges to set. |
SetMonth(int)
Sets the month in a WPF calendar.
Declaration
void SetMonth(int month)
Parameters
| Type | Name | Description |
|---|---|---|
| int | month | A number from 1 to 12. |
SetYear(int)
Sets the year in a WPF calendar.
Declaration
void SetYear(int year)
Parameters
| Type | Name | Description |
|---|---|---|
| int | year | The year to be set for the calendar. |