Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Crash in CarouslePage with ItemTemplate

$
0
0

Given this XAML

<?xml version="1.0" encoding="utf-8" ?>
<CarouselPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Jpost.Views.MainView"
              ItemsSource="{Binding RssCategories}">
    <CarouselPage.ItemTemplate>
        <DataTemplate>
            <ContentPage>
               <Label Text="Test"/>
            </ContentPage>
        </DataTemplate>
    </CarouselPage.ItemTemplate>
</CarouselPage>

and this page

namespace Jpost.Views
{
    public partial class MainView : CarouselPage
    {
        public MainView()
        {
            InitializeComponent();
        }
    }
}

App (android) is crashing with this external code stack (file attached)

Any idea?
Looks like item template is not working so good in CarouselPage?

Changin the page like this for a test working great.

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Jpost.Views.MainView">
     <StackLayout Orientation="Vertical">
        <ListView ItemsSource="{Binding Path=RssCategories}" SelectedItem="{Binding Path=SelectedCategory}">
        <ListView.ItemTemplate>
          <DataTemplate>
            <ViewCell>
              <ViewCell.View>
              <StackLayout Orientation="Horizontal">
                 <Label Text="Hello" />
               </StackLayout>
              </ViewCell.View>
            </ViewCell>
          </DataTemplate>
        </ListView.ItemTemplate>
      </ListView>
      </StackLayout>
</ContentPage>

Thanks,

Ady


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>