SfRotator Custom Behaviour - Essential UI Kit sample

Hi, i would like to ask if you guys have a sample where the custom behaviour will wait for the source coming from service or async method? Currently, the behaviour does not wait for the source to render, it display the first item as blank.



2 Replies 1 reply marked as answer

YA Yas August 8, 2020 10:26 AM UTC

View Model 
try
                {
                    IsBusy = true;
                    await Task.Delay(10);

                    Boardings = await mainPageDataService_.GetBoardingList();

                    // Set bindingcontext to content view.
                    foreach (var boarding in this.Boardings)
                    {
                        boarding.RotatorItem.BindingContext = boarding;
                    }
                }
                finally
                {
                    IsBusy = false;
                }

Code of Custom Behaviour from Essential UI Kit:
 if ( rotator != null && rotator.ItemsSource != null && rotator.ItemsSource.Count() > 0 ) /*DOES NOT WAIT FOR THE SOURCE. THE 1ST ITEM DISPLAY AS BLANK*/
            {
                int itemsCount = rotator.ItemsSource.Count();
                int.TryParse(selectedIndex.ToString(CultureInfo.CurrentCulture), out int index);

                var viewModel = rotator.BindingContext as OnBoardingAnimationViewModel;
                if ( selectedIndex == itemsCount - 1 )
                {
                    viewModel.NextButtonText = "DONE";
                    viewModel.IsSkipButtonVisible = false;
                }
                else


SS Suganya Sethuraman Syncfusion Team August 10, 2020 12:37 PM UTC

Hi Dyel,

Greetings from Syncfusion.

We have prepared a sample with DataTemplate in SfRotator control to display the Images. Could you please use the below DataTemplate sample to resolve the issue,

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/RotatorNavigationDrawer-52950799

Please check with the above and if still the issue exists please modify the above sample with the issue replication steps for us to analyze and provide the solution at the earliest.

Regards,
Suganya Sethuraman. 
 


Marked as answer
Loader.
Up arrow icon