menu

Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SfCalendar - Xamarin.Android API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SfCalendar

    Calendar widget provides the multi-view representation to display and select one or more dates within specified ranges. Also provides a gesture friendly UI to perform operations like navigations, events, etc.

    Inheritance
    System.Object
    SfCalendar
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Namespace: Com.Syncfusion.Calendar
    Assembly: Syncfusion.SfCalendar.Android.dll
    Syntax
    public class SfCalendar : FrameLayout, INotifyPropertyChanged

    Constructors

    SfCalendar(Context)

    Initializes a new instance of the SfCalendar class.

    Declaration
    public SfCalendar(Context context)
    Parameters
    Type Name Description
    Android.Content.Context context

    Context of the view

    SfCalendar(Context, IAttributeSet)

    Initializes a new instance of the SfCalendar class.

    Declaration
    public SfCalendar(Context context, IAttributeSet attribute)
    Parameters
    Type Name Description
    Android.Content.Context context

    Context of the view

    Android.Util.IAttributeSet attribute

    Attribute values

    SfCalendar(Context, IAttributeSet, Int32)

    Initializes a new instance of the SfCalendar class.

    Declaration
    public SfCalendar(Context context, IAttributeSet attribute, int defaultStyleAttribute)
    Parameters
    Type Name Description
    Android.Content.Context context

    Context of the view

    Android.Util.IAttributeSet attribute

    Attribute values

    System.Int32 defaultStyleAttribute

    Default style attribute

    SfCalendar(Context, IAttributeSet, Int32, Int32)

    Initializes a new instance of the SfCalendar class.

    Declaration
    public SfCalendar(Context context, IAttributeSet attribute, int defaultStyleAttribute, int defaultStyleResource)
    Parameters
    Type Name Description
    Android.Content.Context context

    Context of the view

    Android.Util.IAttributeSet attribute

    Attribute value

    System.Int32 defaultStyleAttribute

    Default style attribute

    System.Int32 defaultStyleResource

    Default style resource

    Properties

    AgendaViewHeight

    Gets or sets the height of the agenda view.

    Declaration
    public double AgendaViewHeight { get; set; }
    Property Value
    Type Description
    System.Double

    The height of the agenda view.

    BlackoutDates

    Gets or sets the blackout dates on month view.

    Declaration
    public IList<Date> BlackoutDates { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IList<Java.Util.Date>

    The blackout dates.

    BlackoutDatesViewMode

    Gets or sets the black out dates view mode property for month view to define the appearance of blackout dates in calendar

    Declaration
    public BlackoutDatesViewMode BlackoutDatesViewMode { get; set; }
    Property Value
    Type Description
    BlackoutDatesViewMode

    The view mode.

    CalendarDateHeaderFormat

    Gets or sets the calendar date header format for month view.

    Declaration
    public string CalendarDateHeaderFormat { get; set; }
    Property Value
    Type Description
    System.String

    The calendar date header format.

    CalendarDateHeaderSize

    Gets or sets the size of the calendar date header.

    Declaration
    public int CalendarDateHeaderSize { get; set; }
    Property Value
    Type Description
    System.Int32

    The size of the calendar date header.

    CustomDayLabels

    Gets or sets the custom day labels, used to replace the default day header text.

    Declaration
    public IList<string> CustomDayLabels { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IList<System.String>

    The custom day labels.

    DataSource

    Gets or sets the data source of the blackout dates.

    Declaration
    public CalendarEventCollection DataSource { get; set; }
    Property Value
    Type Description
    CalendarEventCollection

    The data source.

    DisplayDate

    Gets the display date, it holds the current visible month start date.

    Declaration
    public Calendar DisplayDate { get; }
    Property Value
    Type Description
    Java.Util.Calendar

    The display date.

    EnableDatesInPast

    Gets or sets a value indicating whether this SfCalendar enable dates in past.

    Declaration
    public bool EnableDatesInPast { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if enable dates in past then disable the dates until today; otherwise, false.

    FirstDayOfWeek

    Gets or sets the first day of week.

    Declaration
    public int FirstDayOfWeek { get; set; }
    Property Value
    Type Description
    System.Int32

    The first day of week.

    HeaderBackgroundColor

    Gets or sets the color of the header background.

    Declaration
    public Color HeaderBackgroundColor { get; set; }
    Property Value
    Type Description
    Android.Graphics.Color

    The color of the header background.

    HeaderFontAttributes

    Gets or sets the header font attributes.

    Declaration
    public Typeface HeaderFontAttributes { get; set; }
    Property Value
    Type Description
    Android.Graphics.Typeface

    The header font attributes.

    HeaderHeight

    Gets or sets the height of the header on both month and year view.

    Declaration
    public double HeaderHeight { get; set; }
    Property Value
    Type Description
    System.Double

    The height of the header.

    HeaderTextColor

    Gets or sets the color of the header text on month view.

    Declaration
    public Color HeaderTextColor { get; set; }
    Property Value
    Type Description
    Android.Graphics.Color

    The color of the header text.

    HeaderTextSize

    Gets or sets the size of the header text.

    Declaration
    public double HeaderTextSize { get; set; }
    Property Value
    Type Description
    System.Double

    The size of the header text.

    HeaderView

    Gets or sets the header view, it replaces the default header on month and year view.

    Declaration
    public View HeaderView { get; set; }
    Property Value
    Type Description
    Android.Views.View

    The header view.

    InlineViewMode

    Gets or sets the inline view mode.

    Declaration
    public InlineViewMode InlineViewMode { get; set; }
    Property Value
    Type Description
    InlineViewMode

    The inline view mode.

    Locale

    Gets or sets the locale.

    Declaration
    public Locale Locale { get; set; }
    Property Value
    Type Description
    Java.Util.Locale

    The locale.

    MaxDate

    Gets or sets the max date.

    Declaration
    public Calendar MaxDate { get; set; }
    Property Value
    Type Description
    Java.Util.Calendar

    The max date.

    MaximumEventIndicatorCount

    Gets or sets the maximum event indicator count and it is used to defines the visible indicator count on the month cell.

    Declaration
    public int MaximumEventIndicatorCount { get; set; }
    Property Value
    Type Description
    System.Int32

    The maximum event indicator count.

    MinDate

    Gets or sets the minimum visible date of calendar.

    Declaration
    public Calendar MinDate { get; set; }
    Property Value
    Type Description
    Java.Util.Calendar

    The minimum date.

    MonthViewSettings

    Gets or sets the month view settings on month view.

    Declaration
    public MonthViewSettings MonthViewSettings { get; set; }
    Property Value
    Type Description
    MonthViewSettings

    The month view settings.

    MoveToDate

    Gets or sets the move to date and it is used to decide the month to be visible on month view.

    Declaration
    public Calendar MoveToDate { get; set; }
    Property Value
    Type Description
    Java.Util.Calendar

    The move to date.

    NavigateToMonthOnInActiveDatesSelection

    Gets or sets a value indicating whether this SfCalendar navigate to month on in active dates selection.

    Declaration
    public bool NavigateToMonthOnInActiveDatesSelection { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if navigate to month on in active dates selection; otherwise, false.

    NavigationArrowThickness

    Gets or sets the navigation arrow thickness.

    Declaration
    public float NavigationArrowThickness { get; set; }
    Property Value
    Type Description
    System.Single

    The navigation arrow thickness.

    NavigationButtonHeight

    Gets or sets the height of the navigation arrow on the month and year header.

    Declaration
    public float NavigationButtonHeight { get; set; }
    Property Value
    Type Description
    System.Single

    The height of the navigation button.

    NavigationButtonWidth

    Gets or sets the width of the navigation arrow on header.

    Declaration
    public float NavigationButtonWidth { get; set; }
    Property Value
    Type Description
    System.Single

    The width of the navigation button.

    NavigationDirection

    Gets or sets the navigation direction of calendar month view.

    Declaration
    public NavigationDirection NavigationDirection { get; set; }
    Property Value
    Type Description
    NavigationDirection

    The navigation direction.

    NavigationEnable

    Gets or sets a value indicating whether this SfCalendar month view and year view navigation enable.

    Declaration
    public bool NavigationEnable { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if navigation enable; otherwise, false.

    NumberOfWeeksInView

    Gets or sets the value to indicates the number of weeks shown in the month view.

    Declaration
    public int NumberOfWeeksInView { get; set; }
    Property Value
    Type Description
    System.Int32

    The number of weeks in view.

    SelectedDate

    Gets or sets the selected date on single selection mode.

    Declaration
    public Calendar SelectedDate { get; set; }
    Property Value
    Type Description
    Java.Util.Calendar

    The selected date.

    SelectedDates

    Gets or sets the selected dates on multi selection mode.

    Declaration
    public IList<Calendar> SelectedDates { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IList<Java.Util.Calendar>

    The selected dates.

    SelectedRange

    Gets or sets the selected range on range selection mode.

    Declaration
    public List<Calendar> SelectedRange { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<Java.Util.Calendar>

    The selected range.

    SelectedRanges

    Gets or sets the selected ranges on multi range selection mode.

    Declaration
    public List<SelectionRange> SelectedRanges { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<SelectionRange>

    The selected ranges.

    SelectionMode

    Gets or sets the selection mode.

    Declaration
    public SelectionMode SelectionMode { get; set; }
    Property Value
    Type Description
    SelectionMode

    The selection mode.

    ShowEventsInline

    Gets or sets a value indicating whether this SfCalendar show appointment view.

    Declaration
    public bool ShowEventsInline { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if show appointment view; otherwise, false.

    ShowHeader

    Gets or sets a value indicating whether this SfCalendar show header.

    Declaration
    public bool ShowHeader { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if show header; otherwise, false.

    ShowLeadingAndTrailingDays

    Gets or sets a value indicating whether this SfCalendar show leading and trailing days.

    Declaration
    public bool ShowLeadingAndTrailingDays { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if show leading and trailing days; otherwise, false.

    ShowNavigationButtons

    Gets or sets a value indicating whether this SfCalendar show navigation arrows.

    Declaration
    public bool ShowNavigationButtons { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if show navigation buttons; otherwise, false.

    ShowYearView

    Gets or sets a value indicating whether this SfCalendar show year view.

    Declaration
    public bool ShowYearView { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if show year view; otherwise, false.

    ToggleDaySelection

    Gets or sets a value indicating whether this enables SfCalendar toggle day selection. It is used to provide support for deselect the selected date on single selection mode.

    Declaration
    public bool ToggleDaySelection { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if toggle day selection; otherwise, false.

    TransitionMode

    Gets or sets the transition mode.

    Declaration
    public TransitionMode TransitionMode { get; set; }
    Property Value
    Type Description
    TransitionMode

    The transition mode.

    ViewMode

    Gets or sets the view mode.

    Declaration
    public ViewMode ViewMode { get; set; }
    Property Value
    Type Description
    ViewMode

    The view mode.

    VisibleDates

    Gets the visible dates.

    Declaration
    public List<Calendar> VisibleDates { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<Java.Util.Calendar>

    The visible dates.

    YearViewMode

    Gets or sets the view mode.

    Declaration
    public YearViewMode YearViewMode { get; set; }
    Property Value
    Type Description
    YearViewMode

    The view mode.

    YearViewSettings

    Gets or sets the year view settings on year view.

    Declaration
    public YearViewSettings YearViewSettings { get; set; }
    Property Value
    Type Description
    YearViewSettings

    The year view settings.

    Methods

    AddDatesInPast()

    Disable the dates in past.

    Declaration
    public void AddDatesInPast()

    Backward()

    Dependency service for backward the month view or year view.

    Declaration
    public void Backward()

    ClearSelection()

    Method to clear the date selection in calendar.

    Declaration
    public void ClearSelection()

    CollapseInlineView(Calendar)

    Collapses the inline view.

    Declaration
    public void CollapseInlineView(Calendar date)
    Parameters
    Type Name Description
    Java.Util.Calendar date

    Date value

    Dispose(Boolean)

    Dispose the specified disposing.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    If set to true disposing.

    ExpandInlineView(Calendar)

    Expands the inline view.

    Declaration
    public void ExpandInlineView(Calendar date)
    Parameters
    Type Name Description
    Java.Util.Calendar date

    Date value

    Forward()

    Dependency service for forward the month view or year view.

    Declaration
    public void Forward()

    get_IsShowHeader()

    Gets the is show header.

    Declaration
    public bool get_IsShowHeader()
    Returns
    Type Description
    System.Boolean

    true, show header was shown , false otherwise.

    OnConfigurationChanged(Configuration)

    Called when the configuration changed, it is used to identify the device rotation.

    Declaration
    protected override void OnConfigurationChanged(Configuration newConfig)
    Parameters
    Type Name Description
    Android.Content.Res.Configuration newConfig

    New configuration

    OnLayout(Boolean, Int32, Int32, Int32, Int32)

    Called when this view should assign a size and position to all of its children.

    Declaration
    protected override void OnLayout(bool changed, int left, int top, int right, int bottom)
    Parameters
    Type Name Description
    System.Boolean changed

    If set to true changed.

    System.Int32 left

    Left value of the layout

    System.Int32 top

    Top value of the layout

    System.Int32 right

    Right value of the layout

    System.Int32 bottom

    Bottom value of the layout

    OnMeasure(Int32, Int32)

    On the measure.

    Declaration
    protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
    Parameters
    Type Name Description
    System.Int32 widthMeasureSpec

    Width measure spec.

    System.Int32 heightMeasureSpec

    Height measure spec.

    OnPropertyChanged(String)

    Invokes the property changed event in calendar

    Declaration
    protected virtual void OnPropertyChanged(string propertyName)
    Parameters
    Type Name Description
    System.String propertyName

    Property name

    OnSizeChanged(Int32, Int32, Int32, Int32)

    Called when the size changed.

    Declaration
    protected override void OnSizeChanged(int width, int height, int oldWidth, int oldHeight)
    Parameters
    Type Name Description
    System.Int32 width

    The width.

    System.Int32 height

    The height.

    System.Int32 oldWidth

    Old width

    System.Int32 oldHeight

    Old height

    Refresh()

    Provides a support for refreshing the calendar view.

    Declaration
    public void Refresh()

    RefreshHeader()

    Refresh the header layout.

    Declaration
    public void RefreshHeader()

    SetShowHeader(Boolean)

    Sets the show header.

    Declaration
    public void SetShowHeader(bool show)
    Parameters
    Type Name Description
    System.Boolean show

    If set to true show.

    UpdateCalendar()

    Update the calendar.

    Declaration
    public void UpdateCalendar()

    Events

    CalendarTapped

    Occurs when calendar tapped.

    Declaration
    public event EventHandler<CalendarTappedChangedEventArgs> CalendarTapped
    Event Type
    Type
    System.EventHandler<CalendarTappedChangedEventArgs>

    DrawInlineView

    Occurs when draw inline view.

    Declaration
    public event EventHandler<DrawInlineViewEventArgs> DrawInlineView
    Event Type
    Type
    System.EventHandler<DrawInlineViewEventArgs>

    DrawMonthCell

    Occurs when draw month cell.

    Declaration
    public event EventHandler<DrawMonthCellEventArgs> DrawMonthCell
    Event Type
    Type
    System.EventHandler<DrawMonthCellEventArgs>

    DrawMonthHeader

    Occurs when draw month header.

    Declaration
    public event EventHandler<DrawMonthHeaderEventArgs> DrawMonthHeader
    Event Type
    Type
    System.EventHandler<DrawMonthHeaderEventArgs>

    DrawYearCell

    Occurs when draw year cell.

    Declaration
    public event EventHandler<DrawYearCellEventArgs> DrawYearCell
    Event Type
    Type
    System.EventHandler<DrawYearCellEventArgs>

    InlineEventToggled

    Occurs when inline event toggled.

    Declaration
    public event EventHandler<InlineEventToggledEventArgs> InlineEventToggled
    Event Type
    Type
    System.EventHandler<InlineEventToggledEventArgs>

    InlineItemLoaded

    Occurs when inline item loaded.

    Declaration
    public event EventHandler<InlineItemLoadedEventArgs> InlineItemLoaded
    Event Type
    Type
    System.EventHandler<InlineItemLoadedEventArgs>

    InlineItemTapped

    Occurs when inline item tapped.

    Declaration
    public event EventHandler<InlineItemTappedEventArgs> InlineItemTapped
    Event Type
    Type
    System.EventHandler<InlineItemTappedEventArgs>

    MonthCellHolding

    Occurs when month cell holding.

    Declaration
    public event EventHandler<MonthCellHoldingEventArgs> MonthCellHolding
    Event Type
    Type
    System.EventHandler<MonthCellHoldingEventArgs>

    MonthChanged

    Occurs when month changed.

    Declaration
    public event EventHandler<MonthChangedEventArgs> MonthChanged
    Event Type
    Type
    System.EventHandler<MonthChangedEventArgs>

    MonthChanging

    Occurs when month changing.

    Declaration
    public event EventHandler<MonthChangingEventArgs> MonthChanging
    Event Type
    Type
    System.EventHandler<MonthChangingEventArgs>

    MonthNavigated

    Occurs when month navigated.

    Declaration
    public event EventHandler<MonthNavigatedEventArgs> MonthNavigated
    Event Type
    Type
    System.EventHandler<MonthNavigatedEventArgs>

    PropertyChanged

    Occurs when property changed.

    Declaration
    public event PropertyChangedEventHandler PropertyChanged
    Event Type
    Type
    System.ComponentModel.PropertyChangedEventHandler

    SelectionChanged

    Occurs when selection changed.

    Declaration
    public event EventHandler<SelectionChangedEventArgs> SelectionChanged
    Event Type
    Type
    System.EventHandler<SelectionChangedEventArgs>

    ViewModeChanged

    Occurs when view mode changed.

    Declaration
    public event EventHandler<ViewModeChangedEventArgs> ViewModeChanged
    Event Type
    Type
    System.EventHandler<ViewModeChangedEventArgs>

    Implements

    System.ComponentModel.INotifyPropertyChanged
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved