-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
base: main
Are you sure you want to change the base?
Refactor ItemsLayout handling: dynamic default + virtual view-managed subscriptions #29638
Conversation
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). |
@@ -187,7 +187,7 @@ public object PositionChangedCommandParameter | |||
/// <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)
?
f11c626
to
37aba59
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
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
ItemsLayout
property changes and reworking the property change flow.Alternative to #29635 , #28675
Problems
LinearItemsLayout.Vertical
instance as the default for ItemsLayoutWeakNotifyPropertyChangedProxy
to work around this, but that added platform complexity and only masked the root cause.Fix
ItemsLayout
is now created per-instance using defaultValueCreator, not a static object.ItemsView
(virtual view) subscribes directly to changes on itsItemsLayout
and raisesOnPropertyChanged("ItemsLayout")
for relevant internal changes (Span, ItemSpacing, etc.).MapItemsLayout
mapper, which applies platform-specific updates.WeakNotifyPropertyChangedProxy
from Android and Windows for ItemsLayout changes.Issues Fixed
Fixes #29619
Fixes #27666
Fixes #27667
Fixes #28656
Fixes #29696