Bindable layouts #4052
Bindable layouts #4052
Conversation
@StephaneDelcroix All requested changes done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @andreinitescu thanks for your contribution. We will need some unit tests.
UI Tests and a page on the gallery will also be great so we can try this out and test it.
You should also update the description related with the advance scneario as SetController is private now.
Screenshots will also be great.
Thanks
@rmarinho UITests aren't required, it can all be unit-tested |
@StephaneDelcroix @rmarinho @hartez Updates: @rmarinho Regarding your suggestion to update description with relevant advanced scenario for controller: |
4676497
to
a3d8a74
Compare
Squashed the commits |
a3d8a74
to
3676e62
Compare
@StephaneDelcroix @rmarinho @hartez Would appreciate your feedback, thanks! |
Just tested, works fine for me. All my feedback was address. Good job. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm aware of the missed opportunity, we can consider opening this later
Description of Change
It allows any
Layout<View>
to generate its content (child views) by binding to an items source, with option to set item template or item template selector:In the first example, where neither item template nor item template selector are set, every item is a
Label
. If both item template and selector are set, the item template is used. IfItems
property is set, it is ignored.Issues Resolved
API Changes
Added static class BindableLayout with following attached properties to
Layout<View>
:Added private class BindableLayoutController which encapsulates updating layout children based on changes on the collection, item template or item template selector.
Platforms Affected
Testing Procedure
I added a gallery page (see screenshot below) which helps with testing all operations on a collection.
Before/After Screenshots
This change doesn't affect layout appearance, no matter the layout.
However I attached a screenshot which shows the gallery page:
The buttons should be self explanatory. "Replace" turns integers into chars to demonstrate replacing items in the observable collection. "Move" moves first item to last.
PR Checklist
BindableLayoutTests
unit tests)