-
Notifications
You must be signed in to change notification settings - Fork 402
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
[Proposal] Enhance PopupService to provide a set of Close methods #1530
Comments
Since multiple Popups can be displayed concurrently, it'd be best to have the developer specify which popup they'd like to close. void ClosePopup<TPopup>(TPopup poup) where TPopup : IPopup;
void ClosePopup<TPopup>(TPopup poup, object? result = null) where TPopup : IPopup;
void ClosePopup<TPopup>(object? result = null) where TPopup : IPopup;
Task ClosePopupAsync<TPopup>(TPopup poup) where TPopup : IPopup;
Task ClosePopupAsync<TPopup>(TPopup poup, object? result = null) where TPopup : IPopup;
Task ClosePopupAsync<TPopup>(object? result = null) where TPopup : IPopup; Maybe not for this Proposal, but I could also see us adding another API in the future that closes all open popups: void CloseAllPopups();
Task CloseAllPopupsAsync(); |
@brminnick you make a good point re: multiple popups. I like the API surface you have proposed although I think we want to avoid the reliance on a developer providing the Popup type as this is view specific information. We should be able to allow developers to provide the view model like we do with What do you think? |
Yup - that's totally cool with me, because |
I've been thinking on this a little more. While developers can show multiple popups they are effectively stacked on top of each other right? As a user is prevented from interacting with a popup below another popup. I need to test some of this further but if it is the case then we could store the displayed popups inside a Stack and pop them off each time we close. |
I would like to add another request to this, please. Add a way to close the Popups via ViewModel such as Unless I misunderstood the Proposed fixes |
@bijington your proposed stack along with closing via ViewModel is exactly what we need, Thank you .. That would solve all of my concerns .. as long as we can do a close all on the stack |
Feature name
Enhance PopupService to provide a set of Close methods
Link to discussion
#1529
Progress tracker
Summary
We now have the ability to Show popups from view models without any view specific knowledge. Now let's take this functionality further and give developers the ability to Close them too.
Motivation
To make all of our lives easier. Provides symmetry in the PopupService by enabling the ability to close as well as show.
Detailed Design
IPopupService
PopupService
Usage Syntax
Drawbacks
Introduces complexity around maintaining the knowledge of displayed popups.
Alternatives
No response
Unresolved Questions
Do we want to allow for closing based on the view model type? e.g.
PopupService.Close<TViewModel>();
The text was updated successfully, but these errors were encountered: