-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Refactor ItemsLayout handling: dynamic default + virtual view-managed subscriptions #29638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor ItemsLayout handling: dynamic default + virtual view-managed subscriptions #29638
Conversation
rmarinho
left a comment
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.
Can we add the CV2 to the leak tests ?
|
While enabling memory tests for CV2, I found that Anyway, I’ll definitely look into it. Aside from that, everything here looks great. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Only I also noticed that Also, I need to write few UI tests to verify that property changes in |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
|
||
| /// <summary>Bindable property for <see cref="ItemsLayout"/>.</summary> | ||
| public static readonly BindableProperty ItemsLayoutProperty = | ||
| BindableProperty.Create(nameof(ItemsLayout), typeof(LinearItemsLayout), typeof(ItemsView), |
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.
@rmarinho, shouldn't the declaring type here be typeof(CarouselView)?
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.
Yes it should be
f11c626 to
37aba59
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
83996c6 to
b047f48
Compare
b047f48 to
89a8850
Compare
|
Is it realistic to assume that this will come in SR11, related to the milestone? |
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
This PR resolves #29619 by eliminating the memory leak caused by CollectionViewHandler2's subscription to
ItemsLayoutproperty changes and reworking the property change flow.Problems
LinearItemsLayout.Verticalinstance as the default for ItemsLayoutWeakNotifyPropertyChangedProxyto work around this, but that added platform complexity and only masked the root cause.Fix
ItemsLayoutis now created per-instance using defaultValueCreator, not a static object.ItemsView(virtual view) subscribes directly to changes on itsItemsLayoutand raisesOnPropertyChanged("ItemsLayout")for relevant internal changes (Span, ItemSpacing, etc.).MapItemsLayoutmapper, which applies platform-specific updates.WeakNotifyPropertyChangedProxyfrom Android and Windows for ItemsLayout changes.Supersedes to #29635 , #28675 , #29190, #28311
Issues Fixed
Fixes #29619
Fixes #27666
Fixes #27667
Fixes #28656
Fixes #29696
Fixes #28023
Fixes #23377