Skip to content

Handle CarouselView #26

@akamud

Description

@akamud

It will be needed to handle the collection filling manually, since it is only done in the platform code.
https://github.com/xamarin/Xamarin.Forms/blob/5.0.0/Xamarin.Forms.Platform.iOS/CollectionView/TemplatedCell.cs

            if (view is CollectionView cv)
            {
                foreach (var item in cv.ItemsSource)
                {
// Must choose the datatemplate first
                    var temp = cv.ItemTemplate.CreateContent() as View;
                    temp.BindingContext = item;
                    cv.AddLogicalChild(temp);
                }
                var logicalChildren = cv.GetType().GetProperty("LogicalChildrenInternal", BindingFlags.Instance
                        | BindingFlags.NonPublic)
                    .GetValue(cv) as ReadOnlyCollection<Element>;
            }

Selecting data template:
https://github.com/xamarin/Xamarin.Forms/blob/5.0.0/Xamarin.Forms.Platform.iOS/CollectionView/TemplatedCell.cs#L99

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions