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

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

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

5 Replies

DR Dhanasekar R Syncfusion Team 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 



CC CT CHANG 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


DR Dhanasekar R Syncfusion Team 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 



CC CT CHANG January 28, 2019 12:43 PM UTC

Hi Dhanasekar,

Thanks for the update.

Regards,
CT


DR Dhanasekar R Syncfusion Team January 29, 2019 10:20 AM UTC

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


Loader.
Up arrow icon