Hey, I got the error
"no suitable method found to override" in UWP Class
Shared Class
using Xamarin.Forms; namespace TestProject { public class MyCarouselView : CarouselView { public int NewPosition { get; private set; } public MyCarouselView(int newPosition) { Position = newPosition; } } }
UWP Class
using TestProject; using TestProject.UWP; using Xamarin.Forms; using Xamarin.Forms.Platform.UWP; [assembly: ExportRenderer(typeof(MyCarouselView), typeof(CarouselView_UWP))] namespace TestProject.UWP { public class CarouselView_UWP : CarouselViewRenderer { protected override void OnElementChanged(ElementChangedEventArgs<MyCarouselView> e) { base.OnElementChanged(e); if (e.NewElement != null) { e.NewElement.Position = e.NewElement.NewPosition; } } } }
ViewModel
int currentView = Convert.ToInt32(viewIndex); var newInt = new MyCarouselView(currentView);
Reference
https://forums.xamarin.com/discussion/56550/custom-renderer-and-parameters