Hey,
I am using Prism with Xamarin Forms with all the
packages up to date. I am using SfRotator, SfNavigationDrawer etc. in my
project but my issue is with the SfRotator. The images in the rotator
are not being displayed. I have tried using the control which was
not displaying any images. I moved to FFImageLoading which works outside
the SfRotator but not inside. Also, if i put a inside the , or if i use a CachedImageFastRenderer, it throws a NullReferenceException
Following are the code snippets:
MainPage.xaml
<ContentPage xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="xxxxxx.Views.MainPage"
xmlns:navDrawer="clr-namespace:Syncfusion.SfNavigationDrawer.XForms;assembly=Syncfusion.SfNavigationDrawer.XForms"
xmlns:tabView="clr-namespace:Syncfusion.XForms.TabView;assembly=Syncfusion.SfTabView.XForms"
xmlns:rotator="clr-namespace:Syncfusion.SfRotator.XForms;assembly=Syncfusion.SfRotator.XForms"
xmlns:listView="clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms"
xmlns:ffimage="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
Title="{Binding Title}">
<tabView:SfTabItem.Content>
<ScrollView>
<StackLayout>
<rotator:SfRotator ItemsSource="{Binding ImageCollection}"
BackgroundColor="Blue" x:Name="rotator" NavigationStripMode="Dots"
NavigationStripPosition="Bottom" NavigationDelay="100"
NavigationDirection="Horizontal">
<rotator:SfRotator.ItemTemplate>
<DataTemplate>
<ffimage:CachedImage ErrorPlaceholder="Error" Source="{Binding
Image}" HeightRequest="50" WidthRequest="50"
LoadingPlaceholder="Loading..." />
<!--<Image Source="{Binding Image, Converter={StaticResource
EmptyConverter}}" HeightRequest="100" WidthRequest="200" />-->
</DataTemplate>
<!--<DataTemplate>
<Image Source="{Binding Image}"/>
</DataTemplate>-->
<!--
</rotator:SfRotator.ItemTemplate>-->
</rotator:SfRotator.ItemTemplate>
</rotator:SfRotator>
</StackLayout>
</ScrollView>
</tabView:SfTabItem.Content>
</tabView:SfTabItem>
</ContentPage>
MainPageViewModel.cs
public class MainPageViewModel : ViewModelBase
{
private List imageCollection;
public List ImageCollection
{
get { return imageCollection; }
set { SetProperty(ref imageCollection, value); }
}
public MainPageViewModel(INavigationService navigationService)
: base(navigationService)
{
Title = "Main Page";
ImageCollection = new List();
ImageCollection.Add(new OfferSection ("offer1.jpg", "1" ));
ImageCollection.Add(new OfferSection ("offer2.jpg", "2" ));
ImageCollection.Add(new OfferSection ("offer3.png", "3" ));
}
OfferSection.cs
public class OfferSection
{
public string Image { get; set; }
public string OfferId { get; set; }
public OfferSection(string image, string id )
{
Image = image;
OfferId = id;
}
Thanks in advance. Waiting for a prompt response