Rotator does not update when Index updated

I am using the Rotator as a wizard. I am dynamically adding and removing rotator view models based on what the user selected. I am updating the collection that the wizard points to but the rotator control does not show the correct view model. All the binding works as expected except for the rotator updating when I add/remove view models.



What I am doing here is removing the placeholder view model and replacing it with the next view model.



18 Replies

MA Mark August 3, 2018 08:19 AM UTC

Stupid editor will not allow me to resize, delete duplicate images and save.


MA Mark August 3, 2018 08:49 AM UTC

I have made some progress with this. I have used an ObservableCollection and the wizard updates now.

The problem now is that it resets to the first page instead of the page I have just added.

I have bound a WizardIndex property to the rotator SelectedIndex and set it but it doesn't work.

Here is my updated code:


I set the rotator index back to the end after swapping out the pages. It always goes back to the first page.

Do I need to monitor some other event and set the index there?

Thanks

Mark.



PA Paul Anderson S Syncfusion Team August 3, 2018 01:09 PM UTC

Hi Mark, 
  
Thank you for using Syncfusion products. 
  
We are glad that you have achieved your initial requirement with SfRotator control as a Wizard. We tried replicating your sample and we have some missing code impelmentations related ot binding and we couldn't successfully build the sample application. Can you please share a simple replication sample of your application that reproduces the reported issue which will be much helpful in analyzing the issue for your requirement and provide you a better solution. Also share us in which platform you are facing the issue. 
  
  
Regards, 
Paul Anderson 



MA Mark August 6, 2018 09:55 AM UTC

Hi Paul,

I have updated my sample project to show this issue.

This project contains the latest Nugets of:
  • Xamarin.Forms
  • FreshMVVM
  • SFDataGrid
  • SFRotator
  • SFChart
I now get my Xaml template from an embedded resource. This has the advantage that I can edit my template as a Xaml template with intellisense rather than as a string. Also the MVVM patern of a view matching a view model is continued. I also do Event To Command conversion for the Selected Index Changed event.

I add a dummy page to the end of the rotator and swap it out with a page based on the user choice. This works except the rotator is reset to the first page. I then set the index to the last page but this did not work.

See this code in RotatorViewModel for where I do this:

I think I need to hook into another event to achieve what I want to do.

Can you please assist.

Attachment: FreshMVVMSFDataGrid_cafc566a.zip


MA Mark August 13, 2018 07:47 AM UTC

Hi,

Have you had a chance to look at this? Do you have any suggestions for a workaround.

Thanks

Mark.


PA Paul Anderson S Syncfusion Team August 13, 2018 12:59 PM UTC

Hi Mark, 
  
We have checked the reported issue with SfRotator resetting to the first page and when the Data or the ViewModel is changes the Control gets rendered and resets the SelectedIndex which is expericenced in your applicatio. The setting of SelectedIndex after the changes not getting set is confirmed as a defect and logged a defect report. We will fix and will be included in our Volume 2 SP2 release which will be rolled out by the end of August 2018. 
  
Also we currently don't have any possible workaround to achieve your requirement. Hence we will fix and include the fix in our release. 
  
Regards, 
Paul Anderson 



MA Mark August 13, 2018 01:00 PM UTC

Thanks Paul.


PA Paul Anderson S Syncfusion Team August 14, 2018 03:41 AM UTC

Hi Mark, 
  
As promised the fix will be included in VOlume 2 SP2 by the end of August 2018. 
  
Regards, 
Paul Anderson 



PA Paul Anderson S Syncfusion Team August 27, 2018 05:39 AM UTC

Hi Mark, 
 
We are sorry to let you know that due to control stability we have not included the fix “SfRotator resetting to the first page and when the Data or the ViewModel is changes the Control gets rendered and resets the SelectedIndex” in our Volume 2 SP2 release and will be available in our upcoming Volume 3 release which will be rolled out by the end of September 2018. 
 
Regards, 
Paul Anderson 



MA Mark August 27, 2018 09:15 AM UTC

Hi Paul,

Thanks for the update. I am eagerly looking forward to your next update.

Thanks

Mark.


PA Paul Anderson S Syncfusion Team August 27, 2018 09:39 AM UTC

Hi Mark, 
  
Thanks for the update. As promised the fix will be available in Volume 3 2018 release at the end of September 2018. 
  
Regards, 
Paul Anderson 



MA Mark September 20, 2018 01:37 PM UTC

Hi Paul,

Will this fix be in the due to be released update?

Thanks

Mark.


PA Paul Anderson S Syncfusion Team September 21, 2018 03:42 AM UTC

Hi Mark, 
  
The fix has been included in Volume 3 2018 release and will be released within a couple of days. 
  
Regards, 
Paul Anderson 



MA Mark September 27, 2018 11:59 AM UTC

Hi Paul,

This update has fixed the problem for Android only.

This is what I expect:

1. Load Page 1, Page 2 and Placeholder.
2. When get to Placeholder, remove Placeholder and add Page 3.
3. Set index to point to Page 3 i.e. 2.
4. Rotator displays Page 3.

This the result:

1. Android - As above and correct.
2. iOS - Resets to Page 1. On continuing Page 3 is loaded and visible.
3. UWP - Stays on Placeholder. Cannot scroll. If click on Dots Page 3 is not loaded.

I suspect it is a refresh problem. See below for a sample project.

Thanks

Mark.




MA Mark September 27, 2018 12:02 PM UTC

Sample project....

Attachment: FreshMVVMSFDataGrid_20180927_8418ee81.zip


PA Paul Anderson S Syncfusion Team September 28, 2018 11:05 AM UTC

Hi Mark, 
 
Query : "issue on Xamarin.Forms.iOS platform" 
 
We have checked the reported issue on iOS platform, which will get resolved by changing the binding mode of selected index in sample as below given code. 
 
<rotator:SfRotator x:Name="WizardRotator" ItemsSource="{Binding WizardTemplates}" 
                               ItemTemplate="{StaticResource WizardItemTemplate}" EnableLooping="false" 
                               NavigationStripMode="Dots" HeightRequest="500" 
                               HorizontalOptions="FillAndExpand" SelectedIndex="{Binding WizardIndex, Mode=TwoWay}" > 
                <rotator:SfRotator.Behaviors> 
                    <behavior:EventToCommandBehavior EventName="SelectedIndexChanged" 
                                                     Command="{Binding SelectedIndexChangedCommand}" 
                                                     Converter="{StaticResource SelectedIndexChangedConverter}" /> 
                </rotator:SfRotator.Behaviors> 
            </rotator:SfRotator> 
 
 
Query : "Issue on Xamarin.Forms.UWP platform". 
 
We have checked the issue reported on UWP platform, when the SelectedIndex get updated on SfRotator the view inside the rotator is not updated on screen. Once the output window gets resized the view which added inside the SfRotator is getting updated on screen. We will fix this issue from our side and it will be available in our Volume 3 Service pack 1 (October 2018). 
 
Regards, 
Paul Anderson 



MA Mark November 8, 2018 12:00 PM UTC

Fixed, thank you.


PA Paul Anderson S Syncfusion Team November 8, 2018 12:27 PM UTC

Hi Mark, 
  
Thanks for the update. We are glad that your reported issue has been resolved. Please get in touch if you required further assistance. 
  
Regards, 
Paul Anderson 


Loader.
Up arrow icon