-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[.NET10] Made MauiCollectionView on iOS public #29917
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
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.
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
MauiCollectionView
visibility from internal to public - Updated
PublicAPI.Unshipped.txt
for both net-ios and net-maccatalyst to include the new public API entries - Removed duplicate
XmlnsDefinitionAttribute
removal 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
MauiCollectionView
should 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.HostApp
and by shared tests inTestCases.Shared.Tests
—please add or update test cases accordingly.
public class MauiCollectionView : UICollectionView, IUIViewLifeCycleEvents, IPlatformMeasureInvalidationController
@@ -590,4 +594,5 @@ Microsoft.Maui.Controls.Xaml.Internals.AllowImplicitXmlnsDeclarationAttribute | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Copilot uses AI. Check for mistakes.
@@ -65,13 +69,13 @@ public override void MovedToWindow() | |||
} | |||
} | |||
|
|||
internal void SetCustomDelegate(ICustomMauiCollectionViewDelegate customDelegate) | |||
public void SetCustomDelegate(ICustomMauiCollectionViewDelegate customDelegate) |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) =>
{
};
}
}
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.
@PureWeen I've added a commit
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
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 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