-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Move WeakEventManager
to Core.csproj
#5139
Move WeakEventManager
to Core.csproj
#5139
Conversation
/azp run |
Commenter does not have sufficient privileges for PR 5139 in repo dotnet/maui |
I am fine with this being in Core. It might come in handy with our handlers and native events. As long as this doesn't encourage/have us adding events on our interfaces. |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
I've updated this PR to fix the CI errors caused by not previously updating the XML docs references. I think I did it correctly, but would be good to double-check my work with |
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.
Approving this as we probs need it in core and should use it for platform subscriptions.
But, is approval only applies if this feature does not exist in the BCL. It has been years since forms was created, have we added something like this to the BCL yet? Either an API or a language feature?
Thanks @mattleibow!
|
/azp run Edit: Dang - I was really hoping it would work after trying it again a 2nd time 😅 |
Commenter does not have sufficient privileges for PR 5139 in repo dotnet/maui |
Command 'run
Edit:' is not supported by Azure Pipelines.
See additional documentation. |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run |
Pull request contains merge conflicts. |
Head branch was pushed to by a user without write access
Can I get another |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Description of Change
This PR moves
WeakEventManager
to theCore.csproj
project and updates its namespace:WeakEventManager.cs
src/Controls/src/Core/WeakEventManager.cs
->src/Core/src/WeakEventManager.cs
WeakEventManager
Namespacenamespace Microsoft.Maui.Controls
->namespace Microsoft.Maui
Additionally, this PR moves the associated Unit Tests to
Core.UnitTests.csproj
and updates its namespace:WeakEventManagerTests.cs
src/Controls/tests/Core.UnitTests/WeakEventManagerTests.cs
→src/Core/tests/UnitTests/WeakEventManagerTests.cs
WeakEventManagerTests
NamespaceMicrosoft.Maui.Controls.Core.UnitTests
->Microsoft.Maui.UnitTests
Additional Information
On the .NET MAUI Community Toolkit team, we strive to keep the .NET MAUI Community Toolkit architecture aligned with the .NET MAUI architecture. To accomplish this, we have a
CommunityToolkit.Maui.Core
project that maps to the .NET MAUI code inCore.csproj
(aka/src/Core/
).Mimicking .NET MAUI's architecture ensures a frictionless process to promote features from the .NET MAUI Community Toolkit into .NET MAUI once the features have matured and been approved.
We'd really love to use WeakEventManager with our Core project, but right now we can't because it's in the *.Controls namespace.
Moving
WeakEventManager
toCore.csproj
also allows other Frameworks built using .NET MAUI (e.g. Comet, BlazorWebView) to also leverageWeakEventManager
..NET MAUI Community Toolkit Contributions Guide
/~https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#where-to-make-your-changes