question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Discussion: Should ContentDialog in a Desktop WinUI 3 app create a modal top-level window?

See original GitHub issue

Today, the ContentDialog is just XAML content placed on the top of the visual tree. In WPF, ContentDialog is like a MessageBox, which is a modal top-level child window.

Discussion: Should the ContentDialog pivot towards a modal top-level child window?

In this way, ContentDialog won’t need XamlRoot anymore. There are several customer complains that the need of XamlRoot is unintuitive for WPF/Win32 developers (e.g. #2504)

There are several questions that need to be answer:

  1. What parent XAML Window will host the ContentDialog top-level child window. Desktop WinUI 3 apps can have multiple Window objects in the same thread. So, do we need new APIs? For example:
 contentdialog.ShowAsync(mywindow); 
  1. How will the new top-level child ContentDialog work with the RequestedTheme feature?

  2. Will the new ContentDialog work in XAML Islands scenarios? Will be still needed XamlRoot for Islands?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:35 (17 by maintainers)

github_iconTop GitHub Comments

8reactions
mdtaukcommented, Jul 7, 2020

Not directly related, but perhaps relevant for the future… #885 #2313 (My own Task Dialog proposal)

Task Dialog

Whatever modal top-level window is coded/designated for this - could it be extended to other future modal control proposals?

6reactions
mdtaukcommented, Jul 7, 2020

There was a topic about looking at Content Dialog dismissal behaviour #2122 which perhaps could be a behaviour property of the ContentDialog.

That way it could render within the window with Light Dismiss. Include as default, the current behaviour, and add a ModalWindow option, which will create a movable window with only a Close button, or Close and Minimise.

ContentDialog.Behaviour - LightDismiss
                        - Overlay
                        - Modal
Read more comments on GitHub >

github_iconTop Results From Across the Web

Dialog controls - Windows apps
Dialog controls are modal UI overlays that provide contextual app ... Open the WinUI 3 Gallery app and see the ContentDialog in action....
Read more >
winui 3 - Modal dialog in WinUI3 application
I'm new to WinUI3. I'm trying to create a modal dialog using ContentDialog class, but the async nature confuses me. Suppose, there is...
Read more >
A Dialog Service for WinUI 3 | XAML Brewer, by Diederik Krols
I this article we build an MVVM DialogService in a WinUI 3 Desktop application. It comes with the following features: Message Dialog, ...
Read more >
Query English Language Learners
... 'windows-forms-core', 'windows-virtual-desktop', 'window-width', 'winget', 'winston-elasticsearch', 'winsw', 'wintun', 'winui-3', ...
Read more >
Untitled
A deep-dive into WinUI 3 in desktop apps - Windows Blog ContentDialog no Windows 10 UWP - YouTube Teaching tips - Windows apps...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found