We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Initialise components in MainActivity/AppDelegate using MVVMCross

Hey guys,
Im looking to integrate SyncFusion into my Xamarin.Forms app and just seeing if anyone has had an experience initialising the components on App load? I can't seem to get my App to run by overriding the methods explained in the setup for both of the platforms
Thanks!
Aden

3 Replies

JN Jayaleshwari N Syncfusion Team November 26, 2018 02:16 AM

Hi Aden,  
  
Thanks for using Syncfusion products.  
  
We have checked the reported query “How to initialize components in renderer project” from our end. We have prepared the sample using SfListView with MVVMCross and initialize the renderer in the AppDelegate class of the iOS project. No need initialize renderer in android project. Sample is working fine and listview is loaded in the view as expected.  
  
For your reference we have attached the sample and you can download it from the below link.  
  
  
Can you please check the reported issue occurs in our sample also?  Please state whether you have asked about the renderer initialization of the listview. If not, then please share more details about what you want to initialize in the renderer project which would highly help us to analyze the query better and provide an appropriate solution.  
  
Regards,  
Jayaleshwari N 



VF Vito Feleppa December 28, 2018 09:44 AM

Hi, I got the same issue, but for Android.
I don't know when to initialize Syncfusion.XForms.iOS.PopupLayout.SfPopupLayoutRenderer.Init(); on Android.
Which is the call to override and to put the syncfusion init ?
I tried to put on MainActivity.OnCreate() but the sfPopupLayout fails.


JN Jayaleshwari N Syncfusion Team December 31, 2018 06:12 AM

Hi Vito,  
 
Thanks for Contacting Syncfusion Support. 
 
We checked the reported query “To initialize the popup renderer in MVVM Cross sample” from our side. You can resolve the reported issue by initializing the popup renderer in the MainActivity.cs class in Android renderer project, please find the code snippet for the same below.   
 
namespace MvxForms.Droid  
{  
    [Activity(Label = "MvxForms.Droid", Icon = "@drawable/icon", Theme ="@style/MyTheme", ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]  
    public class MainActivity : MvxFormsAppCompatActivity  
    {  
        protected override void OnCreate(Bundle bundle)  
        {  
            base.OnCreate(bundle);  
            TabLayoutResource = Resource.Layout.Tabbar;  
            ToolbarResource = Resource.Layout.Toolbar;  
            Syncfusion.XForms.Android.PopupLayout.SfPopupLayoutRenderer.Init();  
        }  
    }  
}  
 
We have prepared the sample as per your requirement to display popup in MVVM Cross, you can download the same from the following link.  
 
Please let us know if you would require further assistance.  
 
Regards,  
Jayaleshwari N 


Loader.
Live Chat Icon For mobile
Up arrow icon