Migrating from XF Calendar with Events to MAUI SfScheduler

We had a Calendar that dispalyed counts of data or differing types that had been iinput on different days of the month. It looked like this

SmallerCalendarImage.png

The XAML was 


<xforms:SfCalendar
    x:Name="calendar"
    Grid.Row="0"
    DataSource="{Binding CalendarEntries, Mode=OneWay}"
    FirstDayofWeek="1"
    InlineItemTapped="Calendar_InlineItemTapped"
    InlineViewMode="Agenda"
    MaximumEventIndicatorCount="5"
    OnInlineLoaded="Calendar_OnInlineLoaded"
    SelectedDate="{Binding CurrentDate}"
    SelectionMode="SingleSelection"
    ShowInlineEvents="True"
    ShowLeadingAndTrailingDays="False"
    ShowNavigationButtons="True"
    ViewMode="MonthView">
    <xforms:SfCalendar.Behaviors>
        <behaviors:SfCalendarMonthChangedToDateTimeCommandBehavior DateTimeCommand="{Binding MonthChangedCommand}" />
    </xforms:SfCalendar.Behaviors>
    <xforms:SfCalendar.MonthViewSettings>
        <xforms:MonthViewSettings

            AgendaSelectedDateColor="{StaticResource DawnBlueColor}"
            DateSelectionColor="{StaticResource DawnBlueColor}"
            TodaySelectionBackgroundColor="{StaticResource DawnBlueColor}" />
    </xforms:SfCalendar.MonthViewSettings>
</xforms:SfCalendar>

In MAUI i beleive we need to switch to SfScheduler to get the equivalent of the Calendar Entries. I am trying to understand what properties map to what

None of these properties are exposed by the SfScheduler

  •             InlineItemTapped
  •             InlineViewMode="Agenda"
  •             MaximumEventIndicatorCount
  •             OnInlineLoaded
  •             SelectionMode="SingleSelection"
  •             ShowInlineEvents="True"
  •             ShowLeadingAndTrailingDays="False"
  •             ShowNavigationButtons="True"
  •             ViewMode="MonthView"


What are the SfScheduler equivalents?


Thanks






11 Replies

VM Vidyalakshmi Mani Syncfusion Team June 13, 2024 02:03 PM UTC

Hi Pat,


Thank you for reaching out to us. Based on the shared information we have checked your query.


  • MaximumEventIndicatorCountTo customize the number of appointment indicators displayed in month cell you can use the `AppointmentIndicatorCount` as shown in our UG document :  Month-view-Appointment-indicator-count



  • ShowNavigationButtons - You can show or hide the navigation buttons using the `ShowNavigationArrow` property as given in the following UG document: Show-navigation-arrow




  • You can achieve the UI as  shown in the image you have shared by using a ListView and handling the selection changed event. We have detailed this approach in our Knowledge Base documentation. For step-by-step instructions and guidance, please refer to our documentation: How to show the month agenda view in .NET MAUI Scheduler


  • SelectionMode – Currently there is default single selection mode. However, you can customize the cell selection view according to your needs as demonstrated in our UG documentation.


If you have any further questions or need assistance, please feel free to let us know!


Regards,

Vidyalakshmi M.




PA Pat July 5, 2024 04:57 PM UTC

Sorry it has taken so long to reply but migrating our app to MAUI is a massive task for our small team. There are so many things to fix.


Thanks for the pointers on 

  • MaximumEventIndicatorCount 
  • ViewMode 
  • ShowNavigationButtons 
  • ShowLeadingAndTrailingDates

I do not see how our use of  SelectionMode=SingleSelection in anyway maps to SF allopwing us to template the View.

I will look closer at your suggestion to use ListView and handling the selection changed event to replicvate the missing 

UPDATE
In XF we loaded in new Appointments\CalendarEntries when the MonthChanged. To do that we used a Behavior that attached the Calendar.MonthChanged event to a Command in the ViewModel

<scheduler:SfScheduler.Behaviors>

    <behaviors:SfCalendarMonthChangedToDateTimeCommandBehavior DateTimeCommand="{Binding MonthChangedCommand}" />

</scheduler:SfScheduler.Behaviors>


SfScheduler does not have a MonthChanged event so how are we expected to do this?


VM Vidyalakshmi Mani Syncfusion Team July 8, 2024 01:52 PM UTC

Hi Pat,


To achieve your requirement, you can utilize the agenda view in the MAUI SfScheduler control. This view allows you to display appointments in a list format, providing a clear overview of scheduled events. For detailed guidance on setting up and customizing the agenda view, please refer to our User Guide documentation.


Additionally, if you need to view appointments across a month in agenda format, you can make use of the month agenda view as demonstrated in our KB documentation 


If you have any further questions or need assistance, feel free to reach out to us. We're here to help!


Regards,

Vidyalakshmi M.




PA Pat replied to Vidyalakshmi Mani July 8, 2024 04:50 PM UTC

Neither of your suggestions help with the questions


In Xamarin Forms we loaded in new Appointments\CalendarEntries when the MonthChanged. To do that we used a Behavior that attached the Calendar.MonthChanged event to a Command in the ViewModel

<scheduler:SfScheduler.Behaviors>

    <behaviors:SfCalendarMonthChangedToDateTimeCommandBehavior DateTimeCommand="{Binding MonthChangedCommand}" />

</scheduler:SfScheduler.Behaviors>


SfScheduler does not have a MonthChanged event so how are we expected to do this?


VM Vidyalakshmi Mani Syncfusion Team July 9, 2024 01:33 PM UTC

Hi Pat,


To address your requirement of loading new Appointments or Calendar Entries when the view changes, we recommend utilizing the ViewChanged event. This event triggers whenever there is a change in the visible date range or view of the scheduler, which typically includes transitions between months when navigating the calendar view. For more information on handling the ViewChanged event in the MAUI SfScheduler control, you can refer to our User Guide documentation.


Regards,

Vidyalakshmi M.




PA Pat replied to Vidyalakshmi Mani July 10, 2024 07:30 AM UTC

ViewChanged was only firing on initial load, not when moving between months. I will try again now



VM Vidyalakshmi Mani Syncfusion Team July 11, 2024 02:22 PM UTC

Hi Pat,


Regarding your query about the view changed event firing only initially and not when moving between months, we have tested this behavior and confirmed that the view changed event is triggered consistently when navigating between months. We ensured this functionality on Windows, Android, Mac, and iOS platforms. We have attached the tested sample and an output video for your reference. Please check our sample and let us know if you continue to experience the issue.


Regards,

Vidyalakshmi M.



Attachment: SampleAndOutputVideo_59526213.zip


PA Pat July 12, 2024 11:08 AM UTC

I too am seeing it fire as expected now. Sorry for the wasting of your time



VM Vidyalakshmi Mani Syncfusion Team July 15, 2024 01:41 PM UTC

Hi Pat,


We are glad that your issue has been resolved! Please let us know if you need further assistance. As always, we are happy to help you out.


Regards,

Vidyalakshmi M.




PA Pat August 14, 2024 03:37 PM UTC


This is how far we have got with replicating our previous Calendar UI with the SfScheduler. The main difference is the current day  and "today" highlighting


The selected day is that red border which is definetly not what we want and the today highlighting is too small. Can you help?

Screenshot_20240814-162855.png



VM Vidyalakshmi Mani Syncfusion Team August 16, 2024 02:14 PM UTC

Hi Pat,


To customize the color of the selected cell border in the SfScheduler control, you can use the Stroke property in the CellSelectionView. Here’s an example:


 

<scheduler:SfScheduler x:Name="Scheduler" View="Month">

 

      <scheduler:SfScheduler.CellSelectionView>

          <scheduler:SchedulerCellSelectionView Stroke="DarkGreen"/>

      </scheduler:SfScheduler.CellSelectionView>

 

</scheduler:SfScheduler>

 



For additional details, please refer to our user guide documentation on cell selection stroke.


Currently, there is no support for adjusting the size of the "Today" highlight circle.


If you need further assistance, please don’t hesitate to reach out to us.


Regards,

Vidyalakshmi M.



Loader.
Up arrow icon