ClassMonthViewDefinition
Represents definition of a view that shows 42 days in month view mode. This view provides a traditional calendar layout with weeks arranged in rows, allowing users to see an entire month at a glance with appointments displayed within day cells.
Definition
Namespace:Telerik.Maui.Controls
Assembly:Telerik.Maui.Controls.dll
Syntax:
public class MonthViewDefinition : ViewDefinitionBase, INotifyPropertyChanged
Inheritance: objectViewDefinitionBaseMonthViewDefinition
Implements:
Inherited Members
Constructors
MonthViewDefinition()
Initializes a new instance of the MonthViewDefinition class.
Declaration
public MonthViewDefinition()
Fields
DayMoreAppointmentsIndicatorStyleProperty
Identifies the DayMoreAppointmentsIndicatorStyle property.
Declaration
public static readonly BindableProperty DayMoreAppointmentsIndicatorStyleProperty
Field Value
BindableProperty
DayNameStyleSelectorProperty
Identifies the DayNameStyleSelector property.
Declaration
public static readonly BindableProperty DayNameStyleSelectorProperty
Field Value
BindableProperty
DayStringFormatProperty
Identifies the DayStringFormat bindable property.
Declaration
public static readonly BindableProperty DayStringFormatProperty
Field Value
BindableProperty
DayStyleSelectorProperty
Identifies the DayStyleSelector property.
Declaration
public static readonly BindableProperty DayStyleSelectorProperty
Field Value
BindableProperty
FirstDayOfWeekProperty
Identifies the FirstDayOfWeek property.
Declaration
public static readonly BindableProperty FirstDayOfWeekProperty
Field Value
BindableProperty
HorizontalLineStyleProperty
Identifies the HorizontalLineStyle property.
Declaration
public static readonly BindableProperty HorizontalLineStyleProperty
Field Value
BindableProperty
LinesThicknessProperty
Identifies the LinesThickness property.
Declaration
public static readonly BindableProperty LinesThicknessProperty
Field Value
BindableProperty
VerticalLineStyleProperty
Identifies the VerticalLineStyle property.
Declaration
public static readonly BindableProperty VerticalLineStyleProperty
Field Value
BindableProperty
WeekDayStringFormatProperty
Identifies the WeekDayStringFormat bindable property.
Declaration
public static readonly BindableProperty WeekDayStringFormatProperty
Field Value
BindableProperty
Properties
DayMoreAppointmentsIndicatorStyle
Gets or sets the style of the more indicator label when the appointments cannot be visualized. This indicator appears when there are more appointments in a day cell than can be displayed, typically showing text like "+3 more" to indicate additional appointments.
Declaration
public Style DayMoreAppointmentsIndicatorStyle { get; set; }
Property Value
Style
A Style object defining the appearance of the "more appointments" indicator.
Example
// Define custom "more appointments" indicator style
var moreIndicatorStyle = new Style(typeof(Label))
{
Setters =
{
new Setter { Property = Label.TextColorProperty, Value = Colors.Blue },
new Setter { Property = Label.FontSizeProperty, Value = 10 },
new Setter { Property = Label.FontAttributesProperty, Value = FontAttributes.Italic },
new Setter { Property = Label.BackgroundColorProperty, Value = Colors.LightBlue },
new Setter { Property = Label.PaddingProperty, Value = new Thickness(4, 2) }
}
};
monthView.DayMoreAppointmentsIndicatorStyle = moreIndicatorStyle;
DayNameStyleSelector
Gets or sets the style selector of the day names. This style selector controls the appearance of day name headers (Mon, Tue, Wed, etc.) at the top of the month view, allowing different styling for different days.
Declaration
public IStyleSelector DayNameStyleSelector { get; set; }
Property Value
An IStyleSelector that provides styles for day name headers.
Example
// Create custom day name style selector
var dayNameSelector = new DayStyleSelector
{
NormalLabelStyle = new Style(typeof(Label))
{
Setters =
{
new Setter { Property = Label.TextColorProperty, Value = Colors.DarkGray },
new Setter { Property = Label.FontSizeProperty, Value = 12 },
new Setter { Property = Label.FontAttributesProperty, Value = FontAttributes.Bold },
new Setter { Property = Label.HorizontalTextAlignmentProperty, Value = TextAlignment.Center }
}
},
TodayLabelStyle = new Style(typeof(Label))
{
Setters =
{
new Setter { Property = Label.TextColorProperty, Value = Colors.Blue },
new Setter { Property = Label.FontSizeProperty, Value = 12 },
new Setter { Property = Label.FontAttributesProperty, Value = FontAttributes.Bold }
}
}
};
monthView.DayNameStyleSelector = dayNameSelector;
DayStringFormat
Gets or sets the string format of the day date. This property controls how the day numbers are displayed in each day cell of the month view, allowing customization of date presentation.
Declaration
public string DayStringFormat { get; set; }
Property Value
A format string used to display day numbers. Uses standard .NET date format strings.
Example
// Show just the day number (default)
monthView.DayStringFormat = "{0:d}"; // "1", "2", "15", "31"
// Show day with leading zero
monthView.DayStringFormat = "{0:dd}"; // "01", "02", "15", "31"
// Show day with month abbreviation
monthView.DayStringFormat = "{0:d MMM}"; // "1 Jan", "15 Dec"
DayStyleSelector
Gets or sets the style selector of the days. This style selector enables conditional styling of day labels in the month view based on their state, such as highlighting today differently from other days.
Declaration
public IStyleSelector DayStyleSelector { get; set; }
Property Value
An IStyleSelector that provides styles for day labels in the month calendar.
Example
// Create custom day style selector for month view
var daySelector = new DayStyleSelector
{
NormalLabelStyle = new Style(typeof(Label))
{
Setters =
{
new Setter { Property = Label.TextColorProperty, Value = Colors.Black },
new Setter { Property = Label.FontSizeProperty, Value = 14 },
new Setter { Property = Label.HorizontalTextAlignmentProperty, Value = TextAlignment.Center }
}
},
TodayLabelStyle = new Style(typeof(Label))
{
Setters =
{
new Setter { Property = Label.TextColorProperty, Value = Colors.White },
new Setter { Property = Label.BackgroundColorProperty, Value = Colors.Blue },
new Setter { Property = Label.FontSizeProperty, Value = 16 },
new Setter { Property = Label.FontAttributesProperty, Value = FontAttributes.Bold }
}
}
};
monthView.DayStyleSelector = daySelector;
FirstDayOfWeek
Gets or sets the day that is considered the beginning of the week. This property affects how the month grid is laid out, determining which day appears in the first column of the calendar view.
Declaration
public DayOfWeek? FirstDayOfWeek { get; set; }
Property Value
A DayOfWeek value indicating the first day, or null for system default.
Example
// Week starting on Monday (European style)
monthView.FirstDayOfWeek = DayOfWeek.Monday;
// Week starting on Sunday (US style)
monthView.FirstDayOfWeek = DayOfWeek.Sunday;
HorizontalLineStyle
Gets or sets the style of the horizontal lines. Horizontal lines separate different weeks in the month view grid, creating visual separation between week rows in the calendar layout.
Declaration
public Style HorizontalLineStyle { get; set; }
Property Value
Style
A Style object defining the appearance of horizontal separator lines.
Example
// Define horizontal line style for month view
var horizontalLineStyle = new Style(typeof(SchedulerBoxView))
{
Setters =
{
new Setter { Property = BoxView.BackgroundColorProperty, Value = Colors.Gray },
new Setter { Property = BoxView.OpacityProperty, Value = 0.5 }
}
};
monthView.HorizontalLineStyle = horizontalLineStyle;
LinesThickness
Gets or sets the thickness of the lines. This property controls the visual weight of grid lines in the month view, affecting both horizontal and vertical separators between days and weeks.
Declaration
public double LinesThickness { get; set; }
Property Value
A double value representing line thickness in device-independent units.
Example
// Thin lines for subtle grid
monthView.LinesThickness = 0.5;
// Standard thickness
monthView.LinesThickness = 1.0;
// Bold lines for clear separation
monthView.LinesThickness = 2.0;
// No grid lines
monthView.LinesThickness = 0;
VerticalLineStyle
Gets or sets the style of the vertical lines. Vertical lines separate different days in the month view grid, providing visual boundaries between day columns in the calendar layout.
Declaration
public Style VerticalLineStyle { get; set; }
Property Value
Style
A Style object defining the appearance of vertical separator lines.
Example
// Define vertical line style for month view
var verticalLineStyle = new Style(typeof(SchedulerBoxView))
{
Setters =
{
new Setter { Property = SchedulerBoxView.BackgroundColorProperty, Value = Colors.LightGray },
}
};
monthView.VerticalLineStyle = verticalLineStyle;
WeekDayStringFormat
Gets or sets the string format of the week day date. This property controls how the day names are displayed in the header row of the month view, allowing customization of weekday name presentation.
Declaration
public string WeekDayStringFormat { get; set; }
Property Value
A format string used to display weekday names. Uses standard .NET date format strings.
Example
// Show abbreviated day names (default)
monthView.WeekDayStringFormat = "{0:ddd}"; // "Mon", "Tue", "Wed"
// Show full day names
monthView.WeekDayStringFormat = "{0:dddd}"; // "Monday", "Tuesday", "Wednesday"
Methods
CreateDefaultTitle()
Creates the default title for the view definition.
Declaration
protected override string CreateDefaultTitle()
Returns
Overrides