CalendarViewDayItem
CalendarViewDayItem
CalendarViewDayItem
CalendarViewDayItem
Class
Definition
Represents a day on a CalendarView.
public : class CalendarViewDayItem : Control, ICalendarViewDayItempublic class CalendarViewDayItem : Control, ICalendarViewDayItemPublic Class CalendarViewDayItem Inherits Control Implements ICalendarViewDayItem// This API is not available in Javascript.
<CalendarViewDayItem .../>
- Inheritance
-
CalendarViewDayItemCalendarViewDayItemCalendarViewDayItemCalendarViewDayItem
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Inherited Members
Inherited properties
Inherited events
Inherited methods
Remarks
The calendar grid of a CalendarView control is composed of CalendarViewDayItem objects. You typically modify the day item in the CalendarViewDayItemChanging event of either a CalendarView or CalendarDatePicker control. Use the Item property of the CalendarViewDayItemChangingEventArgs to access the CalendarViewDayItem object. For more info, see the, "Updating calendar day items ", section of the CalendarView class remarks.
To improve performance, the visual elements of a CalendarViewDayItem are rendered directly by the control, not defined in the control template as XAML elements. This means you can’t style or re-template these elements. However, CalendarView provides several "calendar item" and "day item" properties that you can use to customize these elements, such as CalendarItemBackground, CalendarItemBorderBrush, and DayItemFontSize.
Even though the visual elements of a CalendarViewDayItem are rendered directly by the control, you can use CalendarView.CalendarViewDayItemStyle to set properties like MinWidth, MinHeight, Margin, and Padding. The default Style (see CalendarViewDayItem styles and template) also includes an empty ControlTemplate that you can use to inject custom XAML elements into the CalendarViewDayItem. Your XAML elements are rendered on top of the background elements, and below the day number and labels.
Use the Date property to get the date represented by this day item. The time portions of this property's DateTime value are ignored. If you compare two dates from a CalendarView, be sure to compare only the Date portion of the DateTime value.
Use the IsBlackout property to get or set a value that indicates whether the date is unavailable.
Call the SetDensityColors method to set the collection of Color values used to display the density bar.
Note
The IsBlackout property and the density colors collection are reset each time the day item container is recycled. If you use these features, you should set the values each time the CalendarViewDayItemChanging event occurs.
Constructors
CalendarViewDayItem() CalendarViewDayItem() CalendarViewDayItem() CalendarViewDayItem()
Initializes a new instance of the CalendarViewDayItem class.
public : CalendarViewDayItem()public CalendarViewDayItem()Public Sub New()// This API is not available in Javascript.
Properties
Date Date Date Date
Gets the date represented by this item.
public : DateTime Date { get; }public DateTimeOffset Date { get; }Public ReadOnly Property Date As DateTimeOffset// This API is not available in Javascript.
- Value
- DateTime DateTimeOffset DateTimeOffset DateTimeOffset
The date represented by this item.
DateProperty DateProperty DateProperty DateProperty
Identifies the Date dependency property.
public : static DependencyProperty DateProperty { get; }public static DependencyProperty DateProperty { get; }Public Static ReadOnly Property DateProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the Date dependency property.
- See Also
IsBlackout IsBlackout IsBlackout IsBlackout
Gets or sets a value that indicates whether the date is unavailable.
public : PlatForm::Boolean IsBlackout { get; set; }public bool IsBlackout { get; set; }Public ReadWrite Property IsBlackout As bool// This API is not available in Javascript.
<CalendarViewDayItem IsBlackout="bool" .../>
- Value
- PlatForm::Boolean bool bool bool
true if the date unavailable; otherwise, false. The default is false.
IsBlackoutProperty IsBlackoutProperty IsBlackoutProperty IsBlackoutProperty
Identifies the IsBlackout dependency property.
public : static DependencyProperty IsBlackoutProperty { get; }public static DependencyProperty IsBlackoutProperty { get; }Public Static ReadOnly Property IsBlackoutProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the IsBlackout dependency property.
- See Also
Methods
SetDensityColors(IIterable)
SetDensityColors(IIterable)
SetDensityColors(IIterable)
SetDensityColors(IIterable)
Sets the collection of Color values used to display the density bar.
public : void SetDensityColors(IIterable<Color> colors)public void SetDensityColors(IEnumerable<Color> colors)Public Function SetDensityColors(colors As IEnumerable<Color>) As void// This API is not available in Javascript.
- colors
- IIterable<Color> IEnumerable<Color> IEnumerable<Color> IEnumerable<Color>
The collection of Color values used to display the density bar.