Closed hartez closed 6 years ago
ItemsSource
and ItemTemplate
should be attached bindable properties, so it could be applied to Grid, StackLayout, Flex, ...
I have updated the proposed spec to reflect the attached property suggestions from GalaxiaGuy and StephaneDelcroix.
RE: https://github.com/xamarin/Xamarin.Forms/issues/1718#issuecomment-394780832
After careful consideration, CollectionView will not cover the scenario from this proposal: https://github.com/xamarin/Xamarin.Forms/issues/3172#issuecomment-424413234
So this proposal is back on the table.
@hartez Typo on the updated spec, both bindable properties are called ItemTemplate
. :)
@hartez Typo on the updated spec, both bindable properties are called
ItemTemplate
. :)
D'oh! Thanks, fixed.
Rationale
Forms does not currently contain a control which displays items from a bound items source in a non-scrollable container.
Implementation
Attached properties targeting
Layout
will be added to support anItemsSource
andItemsTemplate
. Setting these properties will add the templated items to the target layout.The ItemTemplate is responsible for converting the objects in the ItemsSource into
View
objects.Setting the
ItemsSource
will clear out any existing children and update theChildren
collection to match the source.Backward Compatibility
These are new properties, so backward compatibility is likely not an issue.
Difficulty: Moderate