SfCarousel not updating when ObservableCollection is updated!

I will apologize if this comes across as a Rant. I have been struggling to implement SfCarousel for a couple of days now and after finally getting the control to display on screen without build errors. The thing does not load any images that are in the ObservableCollection. 

Secondly, your documentation is outdated. DataSource is Deprecated but it's used throughout the documentation. Very frustrating. Visual Studio didn't pick up that deprecation in the xaml file only when I tried to get the damn thing to work via Code was I notified of that deprecation.

Thirdly, your example project doesn't build. Example projects found in this forum post don't work: https://www.syncfusion.com/forums/125119/is-the-documentation-for-carousel-up-to-date

Is SfCarousel supported? When was the last update? 
Nuget package is 16.1.0.26

Attached is the example I am referring.

Attachment: ExampleProject_14e57ed6.zip

6 Replies

VA Vinnalan Aravazhi Syncfusion Team March 9, 2018 06:54 AM UTC

Hi BmartinGithub,

Thanks for contacting Syncfusion support.

Query 1: SfCarousel does not load any images that are in the ObservableCollection.

We have checked the reported issue from our side and we are unable to reproduce the reported issue for our side. We have attached the sample in which we have checked the reported issue from our side. Please find the sample from below link.

Query 2: DataSource is Deprecated but it is used throughout the documentation

We will update our SfCarousel UG documentation in our upcoming 2018 volume 1 SP 1 release. which will be rolled out by the end of this month.

Query 3: Example projects found in this forum post do not work

We have checked the reported issue from our side, we have updated the sample. Please find the modified sample from below link.

Sample: http://www.syncfusion.com/downloads/support/forum/136309/ze/CarouselSample1086532538 

Regards,
Vinnalan K A.
 



BM bmartinGithub March 9, 2018 10:13 PM UTC

Thank you for the updated example project. There are still some issues I am seeing. First when building fo riOS with view mode = linear I get an error:

Foundation.MonoTouchException: Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: attempt to scroll to invalid index path: <NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0}
Native stack trace:
0   CoreFoundation                      0x0000000112f7512b __exceptionPreprocess + 171
1   libobjc.A.dylib                     0x0000000113c3cf41 objc_exception_throw + 48
2   CoreFoundation                      0x0000000112fea245 +[NSException raise:format:] + 197
3   UIKit                               0x0000000110b4caf3 -[UICollectionView _contentOffsetForScrollingToItemAtIndexPath:atScrollPosition:] + 212
4   UIKit                               0x0000000110b4d569 -[UICollectionView _scrollToItemAtIndexPath:atScrollPosition:animated:] + 70
5   CarouselSample.iOS                  0x000000010f0f58a9 xamarin_dyn_objc_msgSend + 217
6   ???                                 0x000000012570ca72 0x0 + 4923116146

  at ObjCRuntime.Runtime.ThrowNSException (System.IntPtr ns_exception) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/ObjCRuntime/Runtime.cs:359
  at ObjCRuntime.Runtime.throw_ns_exception (System.IntPtr exc) [0x00000] in /Users/builder/data/lanes/5808/1c6f300e/source/xamarin-macios/runtime/Delegates.generated.cs:130
  at at (wrapper native-to-managed) ObjCRuntime.Runtime.throw_ns_exception(intptr)
  at at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSend_IntPtr_UInt64_bool(intptr,intptr,intptr,ulong,bool)
  at UIKit.UICollectionView.ScrollToItem (Foundation.NSIndexPath indexPath, UIKit.UICollectionViewScrollPosition scrollPosition, System.Boolean animated) [0x0001c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/UIKit/UICollectionView.g.cs:713
  at Syncfusion.SfCarousel.iOS.SfCarousel.UpdateViewMode () [0x00273] in <9532235b5c59492eae25dd55ddb752a7>:0
  at Syncfusion.SfCarousel.iOS.SfCarousel.set_ViewMode (Syncfusion.SfCarousel.iOS.SFCarouselViewMode value) [0x00007] in <9532235b5c59492eae25dd55ddb752a7>:0
  at Syncfusion.SfCarousel.XForms.iOS.SfCarouselMapping.OnCarouselPropertiesChanged (System.String propertyName, Syncfusion.SfCarousel.XForms.SfCarousel formsCarousel, Syncfusion.SfCarousel.iOS.SfCarousel nativeCarousel) [0x001f6] in <9f97739ad627435abe92bc3dd9ec3f72>:0
  at Syncfusion.SfCarousel.XForms.iOS.SfCarouselRenderer.OnElementChanged (Xamarin.Forms.Platform.iOS.ElementChangedEventArgs`1[TElement] e) [0x000d8] in <9f97739ad627435abe92bc3dd9ec3f72>:0
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x00118] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0002a] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.PageRenderer.ViewDidLoad () [0x00086] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at at (wrapper managed-to-native) ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper(intptr,intptr)
  at UIKit.UIViewController.get_View () [0x00030] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/UIKit/UIViewController.g.cs:2983
  at Xamarin.Forms.Platform.iOS.PageRenderer.get_NativeView () [0x00008] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.PageRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x0004f] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.Platform.AddChild (Xamarin.Forms.VisualElement view) [0x00027] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.Platform.WillAppear () [0x00043] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.PlatformRenderer.ViewWillAppear (System.Boolean animated) [0x00016] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSend(intptr,intptr)
  at UIKit.UIWindow.MakeKeyAndVisible () [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/UIKit/UIWindow.g.cs:259
  at Xamarin.Forms.Platform.iOS.FormsApplicationDelegate.SetMainPage () [0x00006] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.FormsApplicationDelegate.FinishedLaunching (UIKit.UIApplication uiApplication, Foundation.NSDictionary launchOptions) [0x00028] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at CarouselSample.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x00019] in /Users/bmartin/Downloads/CarouselSample/iOS/AppDelegate.cs:20
  at at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/UIKit/UIApplication.cs:79
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/UIKit/UIApplication.cs:63
  at CarouselSample.iOS.Application.Main (System.String[] args) [0x00001] in /Users/bmartin/Downloads/CarouselSample/iOS/Main.cs:17
I haven't been able to get the duration to do anything in Android or iOS. 

In the project I am working on outside of the example, I was able to get the Android app to load the images, but on iOS no images are displayed. I set up a Converter so I could see if the values are passed in and they are. At some point I saw an error, for iOS stating that the binding could not be found, but the same code works on Android. The images are URL references retrieved via a REST api, if that helps your team debug it.

Thanks again.




VA Vinnalan Aravazhi Syncfusion Team March 12, 2018 01:09 PM UTC

Hi BmartinGithub,

Thanks for the update.

We have checked the reported issue "IOS no images are displayed" from our side and we are unable to reproduce the reported issue from our side. We have attached the sample in which we have checked the reported issue from our side. Please find the sample from the below link.

Sample: http://www.syncfusion.com/downloads/support/forum/136309/ze/ExampleProject-714261807 

So, could you please provide below mentioned details,

1) Modified sample which replicates the reported issue.

2) Which IOS version and device model reported issue gets occur.

It will help us to provide appropriate solution on this.

Regards,
Vinnalan K A.  



BM bmartinGithub March 12, 2018 02:59 PM UTC

I downloaded your example again.

Ran solution for Debug -> iPhoneSimulator -> iPhone X iOS 11.2
Right out of the box I get the Deprecation warning File: ExampleProjectPage.xaml.cs Line: 13 DataSource is deprecated. Screen shot attached.
Changed that line to use ItemsSource.

Reran solution for Debug -> iPhoneSimulator -> iPhone X iOS 11.2
Got an Error about using 32 bit for 64 bit device. 
error MT0117: Can't launch a 32-bit app on a simulator that only supports 64-bit apps (iPhone X).

Changed the Supported Architectures from i386 to x86_64

Reran solution for Debug -> iPhoneSimulator -> iPhone X iOS 11.2
Getting the Foundation.MonoTouchException
Foundation.MonoTouchException: Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: attempt to scroll to invalid index path: <NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0}
Native stack trace:
0   CoreFoundation                      0x000000010b80ed85 __exceptionPreprocess + 165
1   libobjc.A.dylib                     0x000000011410bdeb objc_exception_throw + 48
2   CoreFoundation                      0x000000010b80ecbd +[NSException raise:format:] + 205
3   UIKit                               0x000000010ef8b66f -[UICollectionView scrollToItemAtIndexPath:atScrollPosition:animated:] + 220
4   ExampleProject.iOS                  0x000000010b0f25f9 xamarin_dyn_objc_msgSend + 217
5   ???                                 0x0000000127018652 0x0 + 4949378642

  at ObjCRuntime.Runtime.ThrowNSException (System.IntPtr ns_exception) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/ObjCRuntime/Runtime.cs:359
  at ObjCRuntime.Runtime.throw_ns_exception (System.IntPtr exc) [0x00000] in /Users/builder/data/lanes/5808/1c6f300e/source/xamarin-macios/runtime/Delegates.generated.cs:130
  at at (wrapper native-to-managed) ObjCRuntime.Runtime.throw_ns_exception(intptr)
  at at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSend_IntPtr_UInt64_bool(intptr,intptr,intptr,ulong,bool)
  at UIKit.UICollectionView.ScrollToItem (Foundation.NSIndexPath indexPath, UIKit.UICollectionViewScrollPosition scrollPosition, System.Boolean animated) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/UIKit/UICollectionView.g.cs:713
  at Syncfusion.SfCarousel.iOS.SfCarousel.UpdateViewMode () [0x00273] in <9532235b5c59492eae25dd55ddb752a7>:0
  at Syncfusion.SfCarousel.iOS.SfCarousel.set_ViewMode (Syncfusion.SfCarousel.iOS.SFCarouselViewMode value) [0x00007] in <9532235b5c59492eae25dd55ddb752a7>:0
  at Syncfusion.SfCarousel.XForms.iOS.SfCarouselMapping.OnCarouselPropertiesChanged (System.String propertyName, Syncfusion.SfCarousel.XForms.SfCarousel formsCarousel, Syncfusion.SfCarousel.iOS.SfCarousel nativeCarousel) [0x001f6] in <9f97739ad627435abe92bc3dd9ec3f72>:0
  at Syncfusion.SfCarousel.XForms.iOS.SfCarouselRenderer.OnElementChanged (Xamarin.Forms.Platform.iOS.ElementChangedEventArgs`1[TElement] e) [0x000d8] in <9f97739ad627435abe92bc3dd9ec3f72>:0
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x00118] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0002a] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.PageRenderer.ViewDidLoad () [0x00086] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at at (wrapper managed-to-native) ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper(intptr,intptr)
  at UIKit.UIViewController.get_View () [0x00030] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/UIKit/UIViewController.g.cs:2983
  at Xamarin.Forms.Platform.iOS.PageRenderer.get_NativeView () [0x00008] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.PageRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x0004f] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.Platform.AddChild (Xamarin.Forms.VisualElement view) [0x00027] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.Platform.WillAppear () [0x00043] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.PlatformRenderer.ViewWillAppear (System.Boolean animated) [0x00016] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSend(intptr,intptr)
  at UIKit.UIWindow.MakeKeyAndVisible () [0x00010] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/UIKit/UIWindow.g.cs:259
  at Xamarin.Forms.Platform.iOS.FormsApplicationDelegate.SetMainPage () [0x00006] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at Xamarin.Forms.Platform.iOS.FormsApplicationDelegate.FinishedLaunching (UIKit.UIApplication uiApplication, Foundation.NSDictionary launchOptions) [0x00028] in <bc5a3d4303744676b3b36f4254bb697d>:0
  at ExampleProject.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x00019] in /Users/bmartin/Downloads/ExampleProject-2/iOS/AppDelegate.cs:21
  at at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/UIKit/UIApplication.cs:79
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/UIKit/UIApplication.cs:63
  at ExampleProject.iOS.Application.Main (System.String[] args) [0x00001] in /Users/bmartin/Downloads/ExampleProject-2/iOS/Main.cs:17


Attachment: Warning_Screen_Shot.png_bbb01f41.zip


BM bmartinGithub March 12, 2018 03:02 PM UTC

Attaching Example:

Visual Studio Community 2017 for Mac
Version 7.4 (build 1033)
Installation UUID: 9d26aadb-2ce2-4a9e-8ba9-c2676b97882c
Runtime:
Mono 5.8.0.129 (2017-10/835a98d8559) (64-bit)
GTK+ 2.24.23 (Raleigh theme)

Package version: 508000129

NuGet
Version: 4.3.1.4445

.NET Core
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.0.5
2.0.0
1.1.1
1.0.4
SDK: /usr/local/share/dotnet/sdk/2.1.4/Sdks
SDK Versions:
2.1.4
2.0.0
1.0.3
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.8.0/lib/mono/msbuild/15.0/bin/Sdks

Xamarin.Profiler
Version: 1.6.1
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Xamarin.Android
Version: 8.2.0.15 (Visual Studio Community)
Android SDK: /Users/bmartin/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 27.0.1
SDK Build Tools Version: 27.0.3

Java SDK: /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Xamarin Inspector
Version: 1.4.0
Hash: b3f92f9
Branch: master
Build date: Fri, 19 Jan 2018 22:00:34 GMT
Client compatibility: 1

Apple Developer Tools
Xcode 9.2 (13772)
Build 9C40b

Xamarin.Mac
Version: 4.2.0.20 (Visual Studio Community)

Xamarin.iOS
Version: 11.8.0.20 (Visual Studio Community)
Hash: 1c6f300e
Branch: d15-6
Build date: 2018-02-07 23:42:40-0500

Build Information
Release ID: 704001033
Git revision: 053991068f3c88497d3e5cc52fe7fdf57c28b62f
Build date: 2018-02-28 05:02:28-05
Xamarin addins: cc3283953e0af0b8bfab1bdfdf847d9e403c4606
Build lane: monodevelop-lion-d15-6

Operating System
Mac OS X 10.13.3
Darwin 17.4.0 Darwin Kernel Version 17.4.0
    Sun Dec 17 09:19:54 PST 2017
    root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64

Enabled user installed addins
Android Signature Tool 2.1.2
MvvmCross Template pack 2.0.1
Internet of Things (IoT) development (Preview) 7.1

Debugging in Simulator iPhone X iOS 11.2




Attachment: AlteredExampleProject_6a57f15a.zip


VA Vinnalan Aravazhi Syncfusion Team March 13, 2018 11:26 AM UTC

Hi BmartinGithub,

Thanks for contacting Syncfusion support.

We have checked the reported issue "Application crashes in IOS with SfCarousel linear view mode" from our side and we are able to reproduce the reported issue from our side. Fix will be included our upcoming 2018 Volume 1 SP 1 release and which will be rolled out by the end of this month.

Please let us know if you have any other queries.

Regards,
Vinnalan K A.

Loader.
Up arrow icon