-
Notifications
You must be signed in to change notification settings - Fork 424
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
Popup V2 #1581
base: main
Are you sure you want to change the base?
Popup V2 #1581
Conversation
I have ended up rewriting at least 3 or 4 samples submitted as bugs using standard DI pattern because the code would crash in IOS 17.x. I wanted to verify the issues that were being reported. If I see a bunch of different reports I put extra effort in. Simplifying implementation would be great. I am all for that. |
There are currently a couple of breaking changes to the await popupService.ShowPopupAsync<MockPageViewModel>(CancellationToken.None); becomes await popupService.ShowPopupAsync<MockPageViewModel>(token: CancellationToken.None); await Assert.ThrowsAsync<TaskCanceledException>(() => popupService.ShowPopupAsync<MockPageViewModel>(viewModel => viewModel.HasLoaded = true, cts.Token)); becomes await Assert.ThrowsAsync<TaskCanceledException>(() => popupService.ShowPopupAsync<MockPageViewModel>(viewModel => viewModel.HasLoaded = true, token: cts.Token)); It also involves removing the ability to supply a |
@bijington FYI - we now have a few merge conflicts on this PR after merging a bunch of Popup PRs today |
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.
Copilot reviewed 5 out of 11 changed files in this pull request and generated no suggestions.
Files not reviewed (6)
- samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/MultiplePopupPage.xaml: Language not supported
- samples/CommunityToolkit.Maui.Sample/Views/Popups/PopupContentView.xaml: Language not supported
- samples/CommunityToolkit.Maui.Sample/MauiProgram.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/MultiplePopupViewModel.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/PopupContentViewModel.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/Views/Popups/PopupContentView.xaml.cs: Evaluated as low risk
c1488d0
to
ebc39f2
Compare
aeb9020
to
94bee57
Compare
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.
Good job! I didn't run locally yet, just reviewed the code.
I saw that you removed the old popups reference, and I think we should mark them as obsolete and let them live for a while before removing everything. At least is what I remember from the last standup.
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.
Copilot reviewed 81 out of 96 changed files in this pull request and generated no comments.
Files not reviewed (15)
- samples/CommunityToolkit.Maui.Sample/App.xaml: Language not supported
- samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/MultiplePopupPage.xaml: Language not supported
- samples/CommunityToolkit.Maui.Sample/Resources/Styles/Styles.xaml: Language not supported
- samples/CommunityToolkit.Maui.Sample/Models/PopupSize.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/AppShell.xaml.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/PopupSizingIssuesViewModel.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/StylePopupViewModel.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/PopupPositionViewModel.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/CustomSizeAndPositionPopupViewModel.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/UpdatingPopupViewModel.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/Pages/Views/MediaElement/MediaElementPage.xaml.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/PopupLayoutAlignmentPage.xaml.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/ShowPopupInOnAppearingPage.xaml.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/ViewModels/Views/ViewsGalleryViewModel.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/PopupAnchorViewModel.cs: Evaluated as low risk
Comments suppressed due to low confidence (1)
samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/PopupContentViewModel.cs:8
- The property name 'message' should be renamed to 'Message' to follow PascalCase convention.
string message = "";
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.
Copilot reviewed 81 out of 96 changed files in this pull request and generated no comments.
Files not reviewed (15)
- samples/CommunityToolkit.Maui.Sample/App.xaml: Language not supported
- samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/CustomSizeAndPositionPopupPage.xaml: Language not supported
- samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/MultiplePopupPage.xaml: Language not supported
- samples/CommunityToolkit.Maui.Sample/Resources/Styles/Styles.xaml: Language not supported
- samples/CommunityToolkit.Maui.Sample/Models/PopupSize.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/CustomSizeAndPositionPopupPage.xaml.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/CustomSizeAndPositionPopupViewModel.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/PopupSizingIssuesViewModel.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/AppShell.xaml.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/StylePopupViewModel.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/Pages/Views/MediaElement/MediaElementPage.xaml.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/PopupLayoutAlignmentPage.xaml.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/PopupAnchorViewModel.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/PopupPositionViewModel.cs: Evaluated as low risk
- samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/ShowPopupInOnAppearingPage.xaml.cs: Evaluated as low risk
Comments suppressed due to low confidence (1)
samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/PopupContentViewModel.cs:0
- Ensure that the new PopupContentViewModel class has adequate test coverage for its behavior.
public sealed partial class PopupContentViewModel : BaseViewModel
…dingContext` always matches Popup.BindingContext
https://github.com/CommunityToolkit/Maui into feature/sl/remove-popup-constraint-from-popup-service
…Container ` from `PopupExtensions
src/CommunityToolkit.Maui/Extensions/ServiceCollectionExtensions.shared.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Maui/Extensions/ServiceCollectionExtensions.shared.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Maui/Extensions/ServiceCollectionExtensions.shared.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Pedro Jesus <[email protected]>
…mespaces + Folder Structure
Description of Change
This is primarily aimed at playing around but also with the aim of exposing the implementation to see what everything thinks.
The popupcontainer is an internal ContentPage that is used to display content. there are 2 ways user can create popup. It can be a simple view or for more complex tasks user has to inherit from Popup. What are the complex tasks? In case you want to Close popup from the control or you want to get the result from the popup or you want to subscribe on OnOpened/OnClosed.
For MVVM users there is a PopupService. Pay attention all popups must be registered. Also you can close popup from PopupService only if you opened it using PopupService. DO NOT combine extension method and PopupService.
Now all configurations live in PopupOptions. You can configure BackgroundColor (Dim), popup size and popup layout position. Dissmiss by outside tap also exist in PopupOptions.
The BindingContext is set automatically to PopupContainer, Popup and View.
As the new Popup uses only MAUI Controls, we expect you get all benefits of HotReload. All Controls including Popup in Popup and MediaElement should work without issues.
Features currently removed: AnchorView.
Linked Issues
PR Checklist
approved
(bug) orChampioned
(feature/proposal)main
at time of PRMigration Guide
Popup XAML/CS
You can now use any View as Popup Content without inheriting it from Popup. But if you need to return a result from the popup, you have to inherit from Popup.
Popup Service