Skip to content
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

Provide the ability to show popups without having to subclass Popup #1581

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

bijington
Copy link
Contributor

@bijington bijington commented Nov 29, 2023

Description of Change

This is primarily aimed at playing around but also with the aim of exposing the implementation to see what everything thinks.

Linked Issues

  • Fixes #

PR Checklist

  • Has a linked Issue, and the Issue has been approved(bug) or Championed (feature/proposal)
  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard
  • Documentation created or updated: https://github.com/MicrosoftDocs/CommunityToolkit/pulls

Additional information

@ne0rrmatrix
Copy link
Contributor

ne0rrmatrix commented Dec 1, 2023

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.

@bijington bijington added the needs discussion Discuss it on the next Monthly standup label Dec 5, 2023
@brminnick brminnick removed the needs discussion Discuss it on the next Monthly standup label Jan 4, 2024
bijington and others added 3 commits February 11, 2024 13:45
…able properties

The aim is to allow us to hide the Popup away from developers, or at least simply the usage of showing a popup to not needing to create a Popup implementation
…of github.com:CommunityToolkit/Maui into feature/sl/remove-popup-constraint-from-popup-service
@bijington
Copy link
Contributor Author

There are currently a couple of breaking changes to the IPopupService that I think are still good but we should consider documenting them to aid developers upgrading:

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 viewModel instance to the Show methods to remove the confusion we have seen around developers expecting the BindingContext to automatically be set. I am happy to move this into a separate PR if we think it if worthwhile?

@bijington bijington marked this pull request as ready for review February 11, 2024 14:26
@brminnick
Copy link
Collaborator

@bijington FYI - we now have a few merge conflicts on this PR after merging a bunch of Popup PRs today

@dotnet-policy-service dotnet-policy-service bot added stale The author has not responded in over 30 days help wanted This proposal has been approved and is ready to be implemented labels Apr 27, 2024
@bijington bijington removed help wanted This proposal has been approved and is ready to be implemented stale The author has not responded in over 30 days labels Jun 5, 2024
@bijington bijington requested a review from a team June 9, 2024 20:43
@bijington bijington changed the title Initial musings on showing popups without having to subclass Popup Provide the ability to show popups without having to subclass Popup Jun 20, 2024
@dotnet-policy-service dotnet-policy-service bot added stale The author has not responded in over 30 days help wanted This proposal has been approved and is ready to be implemented labels Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted This proposal has been approved and is ready to be implemented stale The author has not responded in over 30 days
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants