Articles in this section
Category / Section

How to resolve SfCalendar not rendering issue in iOS and UWP Xamarin.Forms(SfCalendar)?

1 min read

Xamarin does not load the renderer assemblies, by default, in iOS and UWP projects. Hence, to solve this, you need to manually load it by calling the Init method of SfCalendarRenderer class in the respective projects as mentioned below.

iOS Project

Call the SfCalendarRenderer.Init() in the FinishedLaunching overridden method of the AppDelegate class after the Xamarin.Forms Framework initialization, and before the LoadApplication is called as demonstrated in the following code example:

using Syncfusion.SfCalendar.XForms.iOS;
 
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
     global::Xamarin.Forms.Forms.Init();
     SfCalendarRenderer.Init();
     LoadApplication(new App());
     return base.FinishedLaunching(app, options);
}

 

UWP Project

The UWP launches the SfCalendar without any initialization and is enough to only initialize the Xamarin.Forms Framework to launch the application

 

ReleaseMode Issue in UWP Platform

The known Framework issue in UWP platform is the custom controls will not render when deployed the application in Release Mode.

The above problem can be resolved by initializing the SfCalendar assemblies in App.xaml.cs in UWP project as in the following code snippet:

// In App.xaml.cs
 
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
    rootFrame.NavigationFailed += OnNavigationFailed;
    // you'll need to add `using System.Reflection;`
    List<Assembly> assembliesToInclude = new List<Assembly>();
    //Now, add all the assemblies your app uses
   assembliesToInclude.Add(typeof(SfCalendarRenderer).GetTypeInfo().Assembly);
   // replaces Xamarin.Forms.Forms.Init(e);
   Xamarin.Forms.Forms.Init(e, assembliesToInclude);
}

 

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