[iOS] Add templated cells as children of the CollectionView2 #26357
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
When porting to the new implementation we forgot to move add the inflated templates as a children of the ItemsView.
This pull request includes several changes to improve the functionality and maintainability of the
ItemsViewController2
andTemplatedCell2
classes, as well as adding a new test case for a specific issue. Also does some cleanupCodebase simplification:
src/Controls/src/Core/Handlers/Items2/iOS/ItemsViewController2.cs
: Removed unused methodsInvalidateMeasureIfContentSizeChanged
,GetSize
, andConstrainItemsToBounds
. Also removed a debugConsole.WriteLine
statement fromDetermineCellReuseId
and updatedUpdateView
to properly disconnect handlers and dispose of views. [1] [2] [3]Enhancements to binding logic:
src/Controls/src/Core/Handlers/Items2/iOS/TemplatedCell2.cs
: Updated theUnbind
method to remove logical children and refactored theBind
method to use a helper methodBindVirtualView
for better code organization and clarity. [1] [2]New test case:
src/Controls/tests/TestCases.HostApp/Issues/Issue26066.xaml
andsrc/Controls/tests/TestCases.HostApp/Issues/Issue26066.xaml.cs
: Added a new test case to address Issue 26066, which involves testing theCollectionViewHandler2
withRelativeSource
binding toAncestorType
. [1] [2]src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue26066.cs
: Added a corresponding test method to verify thatCollectionView2
can find the ancestor type and handle the binding correctly.Issues Fixed
Fixes #26066