swipecards icon indicating copy to clipboard operation
swipecards copied to clipboard

Ambiguous Match Exception

Open LukeTim opened this issue 6 years ago • 0 comments

I have installed the NuGet package and added the CardStackView to the default Xamarin.Forms App template under ItemsPage.xaml with the following piece of XAML

<swipecards:CardStackView
                x:Name="CardStackView"
                ItemsSource="{Binding Items}">
                <swipecards:CardStackView.ItemTemplate>
                    <DataTemplate>
                        <StackLayout Padding="10">
                            <Label Text="{Binding Text}" LineBreakMode="NoWrap" Style="{DynamicResource ListItemTextStyle}" FontSize="16" />
                            <Label Text="{Binding Description}" LineBreakMode="NoWrap" Style="{DynamicResource ListItemDetailTextStyle}" FontSize="13" />
                        </StackLayout>
                    </DataTemplate>
                </swipecards:CardStackView.ItemTemplate>
            </swipecards:CardStackView>

When I run the app, however, I get an Ambiguous Match Exception in the generated code ItemsPage.xaml.g.cs on the following line:

CardStackView = global::Xamarin.Forms.NameScopeExtensions.FindByName<global::SwipeCards.Controls.CardStackView>(this, "CardStackView");

I'm really unsure how to go about debugging this. Is it something I'm doing wrong? It seems, from the exception name, like the code is confused about which of two different objects it should be accessing...

LukeTim avatar May 16 '18 19:05 LukeTim