Articles in this section
Category / Section

How to add locale with RTL in Xamarin.Forms Calender (SfCalendar)

2 mins read

You can change the localization of the calendar in Right-To-Left direction by using the Locale property and FlowDirection property in Xamarin.Forms SfCalendar.

XAML

Change the layout direction of the calendar in the right-to-left direction by setting the FlowDirection to RightToLeft.

<ContentPage.Behaviors>
<local:CalendarPageBehavior/>
</ContentPage.Behaviors>
    <calendar:SfCalendar x:Name="calendar" 
                    FlowDirection="RightToLeft">
    </calendar:SfCalendar>

C#

Set the culture name of the arabic language as "AR" to the Locale property of Calendar.

public class CalendarPageBehavior : Behavior<ContentPage>
{
    SfCalendar calendar;
    protected override void OnAttachedTo(ContentPage bindable)
    {
        base.OnAttachedTo(bindable);
        calendar = bindable.FindByName<SfCalendar>("calendar");
        calendar.Locale = new System.Globalization.CultureInfo("AR");
    }
}

View sample in GitHub

Demo image for RTL

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied