[.NET10] Made MauiCollectionView on iOS public#29917
[.NET10] Made MauiCollectionView on iOS public#29917PureWeen merged 3 commits intodotnet:net10.0from
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR exposes the MauiCollectionView handler on iOS and Mac Catalyst by making the class public and updating the public API listings.
- Changed
MauiCollectionViewvisibility from internal to public - Updated
PublicAPI.Unshipped.txtfor both net-ios and net-maccatalyst to include the new public API entries - Removed duplicate
XmlnsDefinitionAttributeremoval entry in the net-ios API file
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt | Added MauiCollectionView entries for Mac Catalyst public API |
| src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt | Added MauiCollectionView entries and fixed duplicate removal |
| src/Controls/src/Core/Handlers/Items/iOS/MauiCollectionView.cs | Changed MauiCollectionView from internal to public |
Comments suppressed due to low confidence (2)
src/Controls/src/Core/Handlers/Items/iOS/MauiCollectionView.cs:8
- [nitpick] The newly public
MauiCollectionViewshould have corresponding XML docs under/docs/that describe its purpose, usage, and public members.
public class MauiCollectionView : UICollectionView, IUIViewLifeCycleEvents, IPlatformMeasureInvalidationController
src/Controls/src/Core/Handlers/Items/iOS/MauiCollectionView.cs:8
- New public handler behavior should be covered by UI tests in
TestCases.HostAppand by shared tests inTestCases.Shared.Tests—please add or update test cases accordingly.
public class MauiCollectionView : UICollectionView, IUIViewLifeCycleEvents, IPlatformMeasureInvalidationController
| Microsoft.Maui.Controls.Xaml.Internals.AllowImplicitXmlnsDeclarationAttribute.Allow.get -> bool | ||
| Microsoft.Maui.Controls.Xaml.Internals.AllowImplicitXmlnsDeclarationAttribute.AllowImplicitXmlnsDeclarationAttribute(bool allow = true) -> void | ||
| ~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.Target.get -> string | ||
| *REMOVED*~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.XmlnsDefinitionAttribute(string xmlNamespace, string clrNamespace) -> void |
There was a problem hiding this comment.
There’s a duplicate removal entry for XmlnsDefinitionAttribute.XmlnsDefinitionAttribute on line 598—one of these should be removed.
| *REMOVED*~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.XmlnsDefinitionAttribute(string xmlNamespace, string clrNamespace) -> void |
| } | ||
|
|
||
| internal void SetCustomDelegate(ICustomMauiCollectionViewDelegate customDelegate) | ||
| public void SetCustomDelegate(ICustomMauiCollectionViewDelegate customDelegate) |
There was a problem hiding this comment.
hmmmm
I wonder if we can replace this with
IUIViewLifeCycleEvents and use a weak event handler inside MauiCollectionView
There was a problem hiding this comment.
You're thinking about getting rid of public void SetCustomDelegate(ICustomMauiCollectionViewDelegate customDelegate and WeakReference<ICustomMauiCollectionViewDelegate>? _customDelegate;
so that devs would do something like this:
class MyHandler
{
public MyHandler(MauiCollectionView collectionView)
{
((IUIViewLifeCycleEvents)collectionView).MovedToWindow += (s, e) =>
{
};
}
}
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
PureWeen
left a comment
There was a problem hiding this comment.
Can we delete ICustomMauiCollectionViewDelegate
|
/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!
Issues Fixed
Fixes #29844