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

Proposal: Proper modal dialog support #885

Open
knightmeister opened this issue Jun 17, 2019 · 11 comments
Open

Proposal: Proper modal dialog support #885

knightmeister opened this issue Jun 17, 2019 · 11 comments
Assignees
Labels
area-Dialogs feature proposal New feature proposal needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) proposal-NewControl This proposal might involve creating a new control team-Controls Issue for the Controls team

Comments

@knightmeister
Copy link

Proposal: Add proper modal dialog support

Forgive if this is more of a Windows Runtime query rather than WinUI. I'm not sure where the delineation is.

Summary

Windows is an operating system literally built around the concept of managing multiple overlapping windows. Modal dialogs are an important part of any windowing environment, and are present in Win32, WPF, macOS, iOS, etc. UWP has the ContentDialog which is limited and means that sometimes the design needs to be compromised in order to accommodate the ContentDialog.

Rationale

  • Consistency with other desktop operating systems
  • Allows developers to open arbitrary modal dialogs as appropriate within their application.
  • The paradigm should be supported in the same manner on small form factors (would love to see Windows Mobile back...) as other mobile operating systems. Look at what Apple does with [viewController PresentViewController] as an example.
  • Use of a modal allows a clear separation between the primary and ancillary view
@knightmeister knightmeister added the feature proposal New feature proposal label Jun 17, 2019
@maxkatz6
Copy link
Contributor

I think, ContentDialog and/or MessageDialog should be improved instead of adding some new kind of dialog.

@YuliKl
Copy link

YuliKl commented Jun 17, 2019

@stmoy, I believe you had pitched an idea similar to this, is that right?

@shaggygi
Copy link

Referencing #738 and #792

@stmoy stmoy added the needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) label Jun 19, 2019
@stmoy
Copy link
Contributor

stmoy commented Jun 19, 2019

Thank you for filing this issue, @knightmeister . In addition to the list provided in the rationale section above, there are other fundemental deltas between ContentDialog and a true modal dialog including:

  • Blocking the message pump
  • Opening the blocking dialog in a new modal window (to support dragging the dialog around)
  • Having the dialog beep/flash when clicking on the blocked window

The underlying issue is that the UWP Xaml framework doesn't have a true solution for modality. ContentDialog fakes it, but to truly solve this issue, we'd need to change some of the underlying framework in addition to modifying ContentDialog. Hence I've added the "needs-winui-3" tag. We will reassess this issue at that time.

@YuliKl YuliKl removed their assignment Jun 19, 2019
@mdtauk
Copy link
Contributor

mdtauk commented Jun 19, 2019

@stmoy There is a new windowing model being introduced. Windows.UI.WindowManagement.AppWindow

Modal windows could be introduced as a window type here - but I am not sure if this is a WinUI level ask, or if it remains an OS level component.

@stmoy
Copy link
Contributor

stmoy commented Jun 19, 2019

@mdtauk - indeed! The challenge with using AppWindow as the backing type for a modal dialog is exactly what you called out: AppWindow is an OS level component, but we'd need it to be in WinUI 3 if we wanted to update ContentDialog to use it. It's definitely an API that we've talked about leveraging, but the difficulty is that AppWindow doesn't currently support modality either and has the problem of being coupled to the OS.

@knightmeister
Copy link
Author

@stmoy some great points there. For me, I think a true modal should be distinct from ContentDialog - as I see it, both have their own use cases and both could be used within an app.

@YuliKl
Copy link

YuliKl commented Jun 19, 2019

@knightmeister, can you explain this a bit more?

@stmoy Steven Moyes FTE some great points there. For me, I think a true modal should be distinct from ContentDialog - as I see it, both have their own use cases and both could be used within an app.

I'm curious what you see as the downsides of ContentDialog being updated to be truly modal instead of faking it.

@knightmeister
Copy link
Author

Hi @YuliKl, apologies for the late reply been a busy few days.

For me, this comes down to a UX/UI design choice, a proper modal gives a different feel to the app than an in page modal (i.e. the content dialog). I could see myself using both options.

@knightmeister
Copy link
Author

Also to add to my previous reply... I see the use of a ContentDialog analogous to a sheet on macOS.

@sigmarsson
Copy link

@stmoy would it be feasable to enhance a little the ContentDialog to set its dimensions as an inexpensive patch ? Or at least it would seem so. Elastic dimensions would allow better content accomodation and already would be resolving a certain subset of issues out there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Dialogs feature proposal New feature proposal needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) proposal-NewControl This proposal might involve creating a new control team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

9 participants