CarouselView Error

turkdueturkdue USMember ✭✭

Hello,

I am getting an error suggesting that CarouselView is not found, however I downloaded the NuGet and typed the necessarry xaml code ( xmlns:control="clr-namespace:Xamarin.Forms;assembly=Xamarin.Forms.CarouselView" that should make it work. The error is stated below. Can you help?

Position 9:10. Type control:CarouselView not found in xmlns clr-namespace:Xamarin.Forms;assembly=Xamarin.Forms.CarouselView

Best Answer

  • AW.0337AW.0337 RU ✭✭
    edited June 2017 Accepted Answer

    Hi,

    try this:
    - < ContentPage xmlns:control="clr-namespace:Xamarin.Forms;assembly=Xamarin.Forms.CarouselView" >

    And then use in Your Xaml-Markup something like this:
    < StackLayout >
    < control:CarouselView x:Name="xyz" Position="{Binding PositionIndex, Mode=TwoWay}" ItemsSource="{Binding CarouselViewSource}" >
    < /control:CarouselView >
    < /StackLayout >

    Don't forget to add the Xamarin.Forms.CarouselView package to the App-projects too.

    Regards

Answers

  • AW.0337AW.0337 RUMember ✭✭
    edited June 2017 Accepted Answer

    Hi,

    try this:
    - < ContentPage xmlns:control="clr-namespace:Xamarin.Forms;assembly=Xamarin.Forms.CarouselView" >

    And then use in Your Xaml-Markup something like this:
    < StackLayout >
    < control:CarouselView x:Name="xyz" Position="{Binding PositionIndex, Mode=TwoWay}" ItemsSource="{Binding CarouselViewSource}" >
    < /control:CarouselView >
    < /StackLayout >

    Don't forget to add the Xamarin.Forms.CarouselView package to the App-projects too.

    Regards

  • Naveen9453Naveen9453 USMember ✭✭
    edited July 2017

    Hi, @turkdue
    Try This It will help you
    xmlns:local="clr-namespace:xyz" (here in place of xyz Please add your project Namespace)
    xmlns:control="clr-namespace:Xamarin.Forms;assembly=Xamarin.Forms.CarouselView"
    xmlns:forms="clr-namespace:Xamarin.Forms;assembly=Xamarin.Forms.CarouselView"

    and add tamarin.Forms.CarouselView nugget packages to all your app project(iOS,Android....)

    Thanks and Regards.

  • Hi @turkdue
    Try this:

    "To ensure that the CarouselView does not get “Linked-out” when compiling in release mode ensure that you are using Compiled XAML by adding the following code into the project’s AssemblyInfo.cs where your XAMLexists:

    using Xamarin.Forms.Xaml;
    [assembly: XamlCompilation(XamlCompilationOptions.Compile)]

    Or add the following code after the Forms.Init(); call in each project:

    var cv = typeof (Xamarin.Forms.CarouselView);
    var assembly = Assembly.Load(cv.FullName);"

    Hope it works!

Sign In or Register to comment.