AndreiMisiukevich / CardView

CardsView | CarouselView | CoverflowView | CubeView for Xamarin.Forms

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CarouselView with ContentPage does not show content

daltzctr opened this issue · comments

Whenever I set CarouselView ItemSource to a list of ContentPage, the CarouselView does not show anything.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
    x:Class="my_app.Views.DeviceViewRootPage"
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:cards="clr-namespace:PanCardView;assembly=PanCardView"
    xmlns:pages="clr-namespace:my_app.Views"
    xmlns:vm="clr-namespace:my_app.ViewModels">

    <ContentPage.BindingContext>
        <vm:DeviceViewRootPageModel />
    </ContentPage.BindingContext>

    <cards:CarouselView x:Name="CarouselPageRoot">
        <cards:CarouselView.ItemsSource>
            <x:Array Type="{x:Type ContentPage}">
                <pages:ContentPage0 />
                <pages:ContentPage1 />
                <pages:ContentPage2  />
                <pages:ContentPage3 />
                <pages:ContentPage4  />
            </x:Array>
        </cards:CarouselView.ItemsSource>
    </cards:CarouselView>

</ContentPage>

image

Hello, yes, because it's not supposed to work with pages.
Can I ask you, why do you use ContentPage instead ContentView?

I have a multiple of actual ContentPage items which each have their own binding and drastic different layouts. I wish to use CardView as a successor to CarouselPage because current CarouselView also does not support ContentPage. As far as I'm aware, there is no way to get swipe style navigation on Xamarin without CarouselPage, or Maui at all.

Thanks.
Dalton.

Hm, jsut put content from ContentPage to ContentView

I will try that and report back. Thank you.

Works