@gilbertocarcano hi, thank you for feedback
<cards:CarouselView
IsViewCacheEnabled="False">
<cards:CarouselView.ItemsSource>
<x:Array Type="{x:Type View}">
<ContentView>
<Label Text="11111"></Label>
</ContentView>
<ContentView>
<Label Text="22222"></Label>
</ContentView>
</x:Array>
</cards:CarouselView.ItemsSource>
<cards:CarouselView.ItemTemplate>
<DataTemplate>
<ContentView>
<Frame
VerticalOptions="Center"
HorizontalOptions="Center"
HeightRequest="300"
WidthRequest="300"
Padding="0"
HasShadow="False"
IsClippedToBounds="True"
CornerRadius="10"
BackgroundColor="#C0C0C0">
</Frame>
</ContentView>
</DataTemplate>
</cards:CarouselView.ItemTemplate>
<controls:LeftArrowControl ToFadeDuration="3000"/>
<controls:RightArrowControl ToFadeDuration="3000"/>
</cards:CarouselView>
A little bit strange sample :)
You use views as items source and ItemTemplate :)
And you don't use your views in itemsSource..
Ok, as i understand, i can set ItemsSource any two items array and app will crash with this sample.
Have you got any stacktrace of the crash ?
Is it iOS or Android?
Is it Android, I'm not able to test in iOS.
I can't get any staktrace becouse I'm using your plugin as DLL and Visual Studio only says me that there was an exception in the external code.
Ok, i will try to reproduce
Is there any additional info?
Should i rotate screen during swiping or just open screen with you xaml and rotate device.
Thx
Thanks for your response.
The crash happens just opening the screen and rotating the device. I tried IsViewCacheEnabled="True" and the crash go away but this is not an option in my application.
@gilbertocarcano thanks, i'll check
I've downloaded the repo and tried IsViewCacheEnabled ="false" in the CarouselSampleXamlView. The error come from currentViewPair.Value.Clear(), line 492 of CardsView.cs, in the OnSizeChanged() event handler.
@gilbertocarcano super :) your are right _viewsPool is empty, because caching disabled
Do you want to create PR with fix ?)
if (CurrentView != null && ItemTemplate != null)
{
var currentViewPair = _viewsPool.FirstOrDefault(p => p.Value.Contains(CurrentView));
if(currentViewPair != null)
{
currentViewPair.Value.Clear();
currentViewPair.Value.Add(CurrentView);
_viewsPool.Clear();
_viewsPool.Add(currentViewPair.Key, currentViewPair.Value);
}
}
@gilbertocarcano it would be awesome if you adjust this fix and test it on your case :)
I've tried the fix and it works! The test condition is actually currentViewPair.Value!=null and not currentViewPair!=null
Thank you
@gilbertocarcano are you going to make PR or I should fix it myself?
Sorry, I'didn't understand. I don't know what is a PR so i guess you should fix it yourself. :) I'm going to study how github works asaic :). Good new year!
@gilbertocarcano ok)
Most helpful comment
I've downloaded the repo and tried IsViewCacheEnabled ="false" in the CarouselSampleXamlView. The error come from currentViewPair.Value.Clear(), line 492 of CardsView.cs, in the OnSizeChanged() event handler.