question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CarouselView crash on UWP when right or left arrow control is used

See original GitHub issue

Following is working on Android (probably on iOS also, not tested yet) but in UWP it crashes app (exception is System.NullReferenceException: Object reference not set to an instance of an object):

<cards:CarouselView Grid.RowSpan="2" Margin="0" ItemsSource="{Binding CarouselPages}" SelectedIndex="{Binding CarouselPosition, Mode=TwoWay}" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
                    <cards:CarouselView.ItemTemplate>
                        <DataTemplate>
                            <Grid Margin="0" Padding="0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="150"/>
                                </Grid.RowDefinitions>
                                <Frame Grid.Row="0" BorderColor="{StaticResource Accent}" CornerRadius="10" BackgroundColor="{StaticResource White90}" Margin="20,0,20,0" HasShadow="True" Padding="10" WidthRequest="500" HorizontalOptions="Center" VerticalOptions="Center">
                                    <Frame.Content>
                                        <StackLayout HorizontalOptions="Center" VerticalOptions="Center">
                                            <Label Text="{Binding Title}" TextColor="{StaticResource Accent}" FontSize="Medium" HorizontalOptions="Center" VerticalTextAlignment="Center"/>
                                            <Label Text="{Binding Text}" HorizontalOptions="Center" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/>
                                        </StackLayout>
                                    </Frame.Content>
                                </Frame>
                            </Grid>
                        </DataTemplate>
                    </cards:CarouselView.ItemTemplate>
                    <cardscontrols:LeftArrowControl/>
                    <cardscontrols:RightArrowControl/>
                    <cardscontrols:IndicatorsControl SelectedIndicatorStyle="{StaticResource CarouselViewActiveIndicator}" UnselectedIndicatorStyle="{StaticResource CarouselViewInactiveIndicator}"/>
                </cards:CarouselView>

Stack trace on UWP: Xamarin.Forms AnimationExtensions.DoAction (IAnimatable self, Action action) Xamarin.Forms AnimationExtensions.Animate[T] (IAnimatable self, String name, Func2 transform, Action1 callback, UInt32 rate, UInt32 length, Easing easing, Action2 finished, Func1 repeat) Xamarin.Forms AnimationExtensions.Animate (IAnimatable self, String name, Action1 callback, UInt32 rate, UInt32 length, Easing easing, Action2 finished, Func1 repeat) Xamarin.Forms AnimationExtensions.Animate (IAnimatable self, String name, Animation animation, UInt32 rate, UInt32 length, Easing easing, Action2 finished, Func`1 repeat) PanCardView.Utility AnimationWrapper.Commit (View view, String name, UInt32 rate, UInt32 length, Easing easing) PanCardView.Controls.ArrowControl <ResetVisibility>d__53.MoveNext () System.Runtime.ExceptionServices ExceptionDispatchInfo.Throw () System.Runtime.CompilerServices.AsyncMethodBuilderCore <>c.<ThrowAsync>b__6_0 (Object state) System.Threading.WinRTSynchronizationContextBase Invoker.InvokeCore () Windows.ApplicationModel.Core UnhandledError.Propagate () Microsoft.AppCenter.Utils ApplicationLifecycleHelper.<ctor>b__17_1 (Object sender, UnhandledErrorDetectedEventArgs eventArgs)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
AndreiMisiukevichcommented, Dec 3, 2019

well, it’s XF issue, that will be fixed in future releases. here is the workaround:

class LeftArrow: LeftArrowControl {
    protected override void ResetVisibility(uint? appearingTime = null, Easing appearingEasing = null, uint? dissappearingTime = null, Easing disappearingEasing = null) {
        //lave it empty
    }
}

class RightArrow: LeftArrowControl {
    protected override void ResetVisibility(uint? appearingTime = null, Easing appearingEasing = null, uint? dissappearingTime = null, Easing disappearingEasing = null) {
        //lave it empty
    }
}
0reactions
AndreiMisiukevichcommented, Dec 3, 2019

Seems UWP DispatcherProvider causes a crash.

Read more comments on GitHub >

github_iconTop Results From Across the Web

UWP app is crashing due to Xamarin.CarouselView in ...
I reached the conclusion that crash is caused at OnAppearing by a clear call over the list which is set as control's ItemSource....
Read more >
CarouselView.FormsPlugin.Fix 5.2.1
Create Horizontal and Vertical carousels, add page indicators, navigation arrows and much more. “How to” at Github repository.
Read more >
UWP App crash at different screens when using it for a long ...
In our UWP app we have XAML screens with ListView, Grid, ScrollView, ItemsControl like UWP elements. To show HTML content we use Web...
Read more >
Spiffy.Plugins.CarouselView 1.0.0 on NuGet
Create Horizontal and Vertical carousels, add page indicators, navigation arrows and much more. “How to” at Github repository.
Read more >
WPF and UWP Comparison
Indicates the platform (defined by the Avalonia, WPF or UWP column) has the feature ... Bottom, Left and Right instead of dependency properties...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found