Skip to main content

CalendarBlackoutDatesCollection Class

Definition

Assembly:Avalonia.Controls
Package:Avalonia
public class CalendarBlackoutDatesCollection

Inheritance: ObservableCollection<CalendarDateRange> -> CalendarBlackoutDatesCollection

Constructors

CalendarBlackoutDatesCollection Constructor

Initializes a new instance of the Avalonia.Controls.Primitives.CalendarBlackoutDatesCollection class.

public CalendarBlackoutDatesCollection(Avalonia.Controls.Calendar owner)

Parameters

owner Avalonia.Controls.Calendar

The Avalonia.Controls.Calendar whose dates this object represents.

Methods

NameDescription
AddDatesInPastAdds all dates before DateTime.Today to the collection.
Contains (2 overloads)Returns a value that represents whether this collection contains the specified date.
ContainsAnyReturns a value that represents whether this collection contains any date in the specified range.

AddDatesInPast Method

Adds all dates before DateTime.Today to the collection.

public void AddDatesInPast()

Contains overloads

Contains Method

Returns a value that represents whether this collection contains the specified date.

public bool Contains(DateTime date)
Parameters

date DateTime

The date to search for.

Returns

bool

True if the collection contains the specified date; otherwise, false.

Contains Method

Returns a value that represents whether this collection contains the specified range of dates.

public bool Contains(DateTime start, DateTime end)
Parameters

start DateTime

The start of the date range.

end DateTime

The end of the date range.

Returns

bool

True if all dates in the range are contained in the collection; otherwise, false.

ContainsAny Method

Returns a value that represents whether this collection contains any date in the specified range.

public bool ContainsAny(Avalonia.Controls.CalendarDateRange range)

Parameters

range Avalonia.Controls.CalendarDateRange

The range of dates to search for.

Returns

bool

True if any date in the range is contained in the collection; otherwise, false.