Class CalendarYearView
Represents a class which is used to used to configure all the properties and styles of calendar year, decade and century view.
Inheritance
Namespace: Syncfusion.Maui.Calendar
Assembly: Syncfusion.Maui.Calendar.dll
Syntax
public class CalendarYearView : Element, IThemeElement
Constructors
CalendarYearView()
Initializes a new instance of the CalendarYearView class.
Declaration
public CalendarYearView()
Fields
BackgroundProperty
Identifies the Background dependency property.
Declaration
public static readonly BindableProperty BackgroundProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for Background dependency property. |
CellTemplateProperty
Identifies the CellTemplate dependency property.
Declaration
public static readonly BindableProperty CellTemplateProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for CellTemplate dependency property. |
DisabledDatesBackgroundProperty
Identifies the DisabledDatesBackground dependency property.
Declaration
public static readonly BindableProperty DisabledDatesBackgroundProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for DisabledDatesBackground dependency property. |
DisabledDatesTextStyleProperty
Identifies the DisabledDatesTextStyle dependency property.
Declaration
public static readonly BindableProperty DisabledDatesTextStyleProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for DisabledDatesTextStyle dependency property. |
LeadingDatesBackgroundProperty
Identifies the LeadingDatesBackground dependency property.
Declaration
public static readonly BindableProperty LeadingDatesBackgroundProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for LeadingDatesBackground dependency property. |
LeadingDatesTextStyleProperty
Identifies the LeadingDatesTextStyle dependency property.
Declaration
public static readonly BindableProperty LeadingDatesTextStyleProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for LeadingDatesTextStyle dependency property. |
MonthFormatProperty
Identifies the MonthFormat dependency property.
Declaration
public static readonly BindableProperty MonthFormatProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for MonthFormat dependency property. |
RangeTextStyleProperty
Identifies the RangeTextStyle dependency property.
Declaration
public static readonly BindableProperty RangeTextStyleProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for RangeTextStyle dependency property. |
SelectionTextStyleProperty
Identifies the SelectionTextStyle dependency property.
Declaration
public static readonly BindableProperty SelectionTextStyleProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for SelectionTextStyle dependency property. |
TextStyleProperty
Identifies the TextStyle dependency property.
Declaration
public static readonly BindableProperty TextStyleProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for TextStyle dependency property. |
TodayBackgroundProperty
Identifies the TodayBackground dependency property.
Declaration
public static readonly BindableProperty TodayBackgroundProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for TodayBackground dependency property. |
TodayTextStyleProperty
Identifies the TodayTextStyle dependency property.
Declaration
public static readonly BindableProperty TodayTextStyleProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for TodayTextStyle dependency property. |
Properties
Background
Gets or sets the background for the year, decade and century cells of the calendar year, decade and century view.
Declaration
public Brush Background { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | The default value of Background is Transparent. |
Examples
The following code demonstrates, how to use the Background property in the calendar
this.Calendar.YearView.Background = Colors.PaleGreen;
See Also
CellTemplate
Gets or sets the year cell template or template selector.
Declaration
public DataTemplate CellTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.DataTemplate | The default value of CellTemplate is null. |
Remarks
The BindingContext of the CellTemplate is the CalendarCellDetails If the cell template is not null, Range selection direction of forward, backward and both direction does not drawn the dashed line hovering. Hovering draws like default range selection direction.
Examples
The following code demonstrates, how to use the Cell Template property in the year view. #XAML
<calendar:SfCalendar x:Name= "Calendar" View = "Decade">
< calendar:SfCalendar.YearView>
<calendar:CalendarYearView>
<calendar:CalendarYearView.CellTemplate>
<DataTemplate>
<Grid BackgroundColor = "Pink" >
< Label HorizontalTextAlignment= "Center" VerticalTextAlignment= "Center" TextColor= "Purple" Text= "{Binding Date.Year}" />
</Grid >
</ DataTemplate >
</ calendar:CalendarYearView.CellTemplate>
</calendar:CalendarYearView>
</calendar:SfCalendar.YearView>
</calendar:SfCalendar>
this.Calendar.View = CalendarView.Decade;
this.Calendar.YearView = new CalendarYearView()
{
CellTemplate = dataTemplate,
};
DataTemplate dataTemplate = new DataTemplate(() =>
{
Grid grid = new Grid
{
BackgroundColor = Colors.Pink,
};
Label label = new Label
{
HorizontalTextAlignment = TextAlignment.Center,
VerticalTextAlignment = TextAlignment.Center,
TextColor = Colors.Purple,
};
label.SetBinding(Label.TextProperty, new Binding("Date.Year"));
grid.Children.Add(label);
return grid;
});
See Also
DisabledDatesBackground
Gets or sets the background for the disabled year, decade and century cells of the calendar year, decade and century view.
Declaration
public Brush DisabledDatesBackground { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | The default value of DisabledDatesBackground is Transparent. |
Examples
The following code demonstrates, how to use the DisabledDatesBackground property in the calendar
this.Calendar.YearView.DisabledDatesBackground = Colors.Grey;
See Also
DisabledDatesTextStyle
Gets or sets the text style of the disabled year, decade and century cells text, that used to customize the text color, font, font size, font family and font attributes.
Declaration
public CalendarTextStyle DisabledDatesTextStyle { get; set; }
Property Value
Type |
---|
CalendarTextStyle |
Examples
The following code demonstrates, how to use the DisabledDatesTextStyle property in the calendar
CalendarTextStyle textStyle = new CalendarTextStyle()
{
FontSize = 14,
TextColor = Colors.Red,
};
this.Calendar.YearView.DisabledDatesTextStyle = textStyle;
See Also
LeadingDatesBackground
Gets or sets the background for the leading decade and century cells of the calendar decade and century view.
Declaration
public Brush LeadingDatesBackground { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | The default value of LeadingDatesBackground is Transparent. |
Examples
The following code demonstrates, how to use the LeadingDatesBackground property in the calendar
this.Calendar.YearView.LeadingDatesBackground = Colors.Red;
See Also
LeadingDatesTextStyle
Gets or sets the text style of the leading decade and century cells text, that used to customize the text color, font, font size, font family and font attributes.
Declaration
public CalendarTextStyle LeadingDatesTextStyle { get; set; }
Property Value
Type |
---|
CalendarTextStyle |
Examples
The following code demonstrates, how to use the LeadingDatesBackground property in the calendar
CalendarTextStyle textStyle = new CalendarTextStyle()
{
FontSize = 14,
TextColor = Colors.Red,
};
this.Calendar.YearView.LeadingDatesTextStyle = textStyle;
See Also
MonthFormat
Gets or sets the format to customize the month text in calendar year view.
Declaration
public string MonthFormat { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value of MonthFormat is "MMM". |
Remarks
It is only applicable for Year view.
Examples
The following code demonstrates, how to use the MonthFormat property in the calendar
this.Calendar.YearView.MonthFormat = "MMM";
See Also
RangeTextStyle
Gets or sets the text style of the range in-between year, decade and century cells text, that used to customize the text color, font, font size, font family and font attributes.
Declaration
public CalendarTextStyle RangeTextStyle { get; set; }
Property Value
Type |
---|
CalendarTextStyle |
Examples
The following code demonstrates, how to use the RangeTextStyle property in the calendar
CalendarTextStyle textStyle = new CalendarTextStyle()
{
FontSize = 14,
TextColor = Colors.Red,
};
this.Calendar.YearView.RangeTextStyle = textStyle;
See Also
SelectionTextStyle
Gets or sets the text style of the selection year, decade and century cells text, that used to customize the text color, font, font size, font family and font attributes.
Declaration
public CalendarTextStyle SelectionTextStyle { get; set; }
Property Value
Type |
---|
CalendarTextStyle |
Examples
The following code demonstrates, how to use the SelectionTextStyle property in the calendar
CalendarTextStyle textStyle = new CalendarTextStyle()
{
FontSize = 14,
TextColor = Colors.Red,
};
this.Calendar.YearView.SelectionTextStyle = textStyle;
See Also
TextStyle
Gets or sets the text style of the year, decade and century cells text, that used to customize the text color, font, font size, font family and font attributes.
Declaration
public CalendarTextStyle TextStyle { get; set; }
Property Value
Type |
---|
CalendarTextStyle |
Examples
The following code demonstrates, how to use the TextStyle property in the calendar
CalendarTextStyle textStyle = new CalendarTextStyle()
{
FontSize = 14,
TextColor = Colors.Red,
};
this.Calendar.YearView.TextStyle = textStyle;
See Also
TodayBackground
Gets or sets the background for the today year, decade and century cell of the calendar year, decade and century view.
Declaration
public Brush TodayBackground { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | The default value of TodayBackground is Transparent. |
Examples
The following code demonstrates, how to use the TodayBackground property in the calendar
this.Calendar.YearView.TodayBackground = Colors.Pink;
See Also
TodayTextStyle
Gets or sets the text style of the today year, decade and century cell text, that used to customize the text color, font, font size, font family and font attributes.
Declaration
public CalendarTextStyle TodayTextStyle { get; set; }
Property Value
Type |
---|
CalendarTextStyle |
Examples
The following code demonstrates, how to use the TodayTextStyle property in the calendar
CalendarTextStyle textStyle = new CalendarTextStyle()
{
FontSize = 14,
TextColor = Colors.Red,
};
this.Calendar.YearView.TodayTextStyle = textStyle;