Back to Devexpress

DateEdit.PickerCustomDayOfWeekCellStyle Event

mobilecontrols-devexpress-dot-xamarinforms-dot-editors-dot-dateedit.md

latest2.3 KB
Original Source

DateEdit.PickerCustomDayOfWeekCellStyle Event

Allows you to customize days of the week in the default picker.

Namespace : DevExpress.XamarinForms.Editors

Assembly : DevExpress.XamarinForms.Editors.dll

NuGet Package : DevExpress.XamarinForms.Editors

Declaration

csharp
public event EventHandler<CustomDayOfWeekCellStyleEventArgs> PickerCustomDayOfWeekCellStyle

Event Data

The PickerCustomDayOfWeekCellStyle event's data class is CustomDayOfWeekCellStyleEventArgs. The following properties provide information specific to this event:

PropertyDescription
DayOfWeekGets the processed day of the week.

Example

The example below shows how to apply a custom style to weekends (days in the calendar and days of the week).

cs
using DevExpress.XamarinForms.Editors;

void CustomDayCellStyle(object sender, CustomSelectableCellStyleEventArgs e) {
    if (e.Date.DayOfWeek == DayOfWeek.Saturday || e.Date.DayOfWeek == DayOfWeek.Sunday) {
        e.TextColor = Color.FromHex("F44848");
        if(e.IsTrailing)
            e.TextColor = Color.FromRgba(e.TextColor.R, e.TextColor.G, e.TextColor.B, 0.5);
    }
}

private void CustomDayOfWeekCellStyle(object sender, CustomDayOfWeekCellStyleEventArgs e) {
    if(e.DayOfWeek == DayOfWeek.Saturday || e.DayOfWeek == DayOfWeek.Sunday)
        e.TextColor = Color.FromHex("F44848");
}
xml
<dxe:DateEdit PickerCustomDayCellStyle="CustomDayCellStyle"
              PickerCustomDayOfWeekCellStyle="CustomDayOfWeekCellStyle"/>

See Also

UseNativePicker

DateEdit Class

DateEdit Members

DevExpress.XamarinForms.Editors Namespace