dotnet / dotnet/maui-samples

ListView inside a CarouselView... getting cast exception

Open
#334 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
3.7k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

I was trying to add the following to CarouselViewDemos/Views/Indicators/HorizontalLayoutWithIndicatorsPage.xaml|
```









```
and I have this in:
CarouselViewDemos/Models/Monkey.cs
```
namespace CarouselViewDemos.Models
{
public class Monkey
{
public string Name { get; set; }
public List Class { get; set; }
public string Location { get; set; }
public string Details { get; set; }
public string ImageUrl { get; set; }
public bool IsFavorite { get; set; }
}
}
```
and last... I've updated the hard-coded data like this in:
CarouselViewDemos/ViewModels/MonkeysViewModel.cs
```
source.Add(new Monkey
{
Name = "Capuchin Monkey",
Class = new List() { "A", "B" },
Location = "Central & South America",
Details = "The capuchin monkeys are New World monkeys of the subfamily Cebinae. ... a single genus, Cebus.",
ImageUrl = "https://upload.wikimedia.org/.....jpg/200px-Capuchin_Costa_Rica.jpg"
});
```
But I get a cast exception error.
Commenting out the ListView in the xaml... and things run... so I guess it is something to do with how I'm setting up the xaml???

Any ideas?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.