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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SfRotator keep creating a new instance of control defined inside DataTemplate on each time switch to next item

Thread ID:

Created:

Updated:

Platform:

Replies:

142239 Jan 24,2019 03:43 AM UTC Jan 29,2019 10:20 AM UTC Xamarin.Forms 5
loading
Tags: SfRotator
CT CHANG
Asked On January 24, 2019 03:43 AM UTC

Hi,

I am using the SfRotator and updated to the latest 16.4.0.48 version.

But, I notice a new instance of the control defined inside the DataTemplate will be created on each time the SfRotator move to next image (I have set the SfRotator with EnableAutiPlay and EnableLooping).

In my attached sample code. The SfRotator is bind to a data source (Items) with total 3 items in the collection. So, should the SfRotator only create 3 instance of the control defined inside the DataTemplate? Infact, the SfRotator will keep create a new instance of those controls defined inside DataTemplate.

This will be a problem, when the image is from internet. It is no good to keep download the image from internet. Instead, I derived my own AdvImage control that wil;l check the local previous downloaded copy and load it. Otherwise, download from the given URL.

Regards,
CT


Attachment: Sample_2a102c02.zip

Dhanasekar R [Syncfusion]
Replied On January 25, 2019 12:53 PM UTC

Hi CHANG, 
 
Greetings from Syncfusion. 
 
In our current implementation of SfRotator, we have used the virtualization support. (For example : If we use 1000 items on SfRotatorItem, it will take more time to load the control) 
 
Hence when the item get loaded on the view, that particular item instance will get created and it will be removed when the next item get viewed on the rotator item. This is the reason the view get created every time when the item get changed. 
 
Currently we have considered this implementation of SfRotator Item without creating new instance for the items which has been already viewed. We have added this feature request to our database. You can now track the current status of this feature request here 

Feedback:  https://www.syncfusion.com/feedback/4451

We have planned to include this improvement in our upcoming 2019 Volume 1 release which is expected to be released by mid of March 2019.  
 
Regards, 
Dhanasekar 


CT CHANG
Replied On January 25, 2019 01:56 PM UTC

Hi Dhanasekar,

I understand the design and the benefit of using virtualisation. I also agree and no issue to create a new instance each time the view is loaded.

I try to detect the control Unloaded event via the Effect behavior. Unfortunately, I only manage to captured the Loaded event.

My concern will be resolve if there is a way to detect the control has been unloaded.

Do you have any suggestion or correct way on detecting the control being removed from the SfRotator?

Regards,
CT

Dhanasekar R [Syncfusion]
Replied On January 28, 2019 12:01 PM UTC

Hi CHANG,  
  
Thanks for the update. 
 
As of now, we don’t have any event when control being removed from the SfRotator. We will also consider this requirement while implementing the following improvement.  
 
 
We will let you once these changes are included in SfRotator. We appreciate your patience until then. 
 
Regards, 
Dhanasekar 


CT CHANG
Replied On January 28, 2019 12:43 PM UTC

Hi Dhanasekar,

Thanks for the update.

Regards,
CT

Dhanasekar R [Syncfusion]
Replied On January 29, 2019 10:20 AM UTC

Hi CHANG,   
 
Welcome. We will let you once these changes are included in SfRotator 
 
Regards, 
Dhanasekar 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon