Class MonthCell
Month cell argument class.
Namespace: Syncfusion.SfCalendar.XForms
Assembly: Syncfusion.SfCalendar.XForms.dll
Syntax
public class MonthCell : EventArgs
Constructors
MonthCell(DateTime)
Initializes a new instance of the MonthCell class.
Declaration
public MonthCell(DateTime calendar)
Parameters
| Type | Name | Description |
|---|---|---|
| System.DateTime | calendar | Calendar. |
Properties
AccessibilityLabelText
Gets or sets the accessibility label text to read calendar dates.
Declaration
public string AccessibilityLabelText { get; set; }
Property Value
| Type |
|---|
| System.String |
Remarks
By default, Calendar read the date as in the format (EEEE dd/MMMM/yyyy), for an example Friday 10/October/2022. AccessibilityLabelText property can be used to change the calendar date accessibility format like dates with events for the days.
Examples
The following example describes to get and set the accessibility label text with events.
#[C#](#tab/tabid-1)Calendar.OnMonthCellLoaded += OnMonthCellLoaded;
private void OnMonthCellLoaded(object sender, MonthCellLoadedEventArgs e)
{
var visibleAppointments = this.GetVisibleAppointments(e.Date);
if (visibleAppointments.Count > 0)
{
e.AccessibilityLabelText = e.Date.ToString("dddd dd/MMMM/yyyy") + " has " + visibleAppointments.Count.ToString() + " events";
}
}
private CalendarEventCollection GetVisibleAppointments(DateTime currentDate)
{
CalendarEventCollection appointments = new CalendarEventCollection();
if (calendar.DataSource == null)
return appointments;
foreach (CalendarInlineEvent app in calendar.DataSource)
{
if ((app.StartTime.Date <= currentDate.Date) && (currentDate.Date <= app.EndTime.Date))
appointments.Add(app);
}
return appointments;
}
BackgroundColor
Gets or sets the color of the background.
Declaration
public Color BackgroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Xamarin.Forms.Color | The color of the background. |
BorderColor
Gets or sets the color of the border.
Declaration
public Color BorderColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Xamarin.Forms.Color | The color of the border. |
CellBindingContext
Gets or sets the view.
Declaration
public object CellBindingContext { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object | The view. |
Date
Gets the date.
Declaration
public DateTime Date { get; }
Property Value
| Type | Description |
|---|---|
| System.DateTime | The date. |
Font
Gets or sets the font.
Declaration
public Font Font { get; set; }
Property Value
| Type | Description |
|---|---|
| Xamarin.Forms.Font | The font. |
FontAttribute
Gets or sets the font attribute.
Declaration
public FontAttributes FontAttribute { get; set; }
Property Value
| Type | Description |
|---|---|
| Xamarin.Forms.FontAttributes | The font attribute. |
FontFamily
Gets or sets the font family.
Declaration
public string FontFamily { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The font family. |
IsCurrentMonth
Gets a value indicating whether it is current month or not.
Declaration
public bool IsCurrentMonth { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | The view. |
TextColor
Gets or sets the color of the text.
Declaration
public Color TextColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Xamarin.Forms.Color | The color of the text. |
View
Gets or sets the view.
Declaration
public View View { get; set; }
Property Value
| Type | Description |
|---|---|
| Xamarin.Forms.View | The view. |