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: Modern WinUI MessageDialog/MessageBox #6559

Open
tom-huntington opened this issue Jan 8, 2022 · 4 comments
Open

Proposal: Modern WinUI MessageDialog/MessageBox #6559

tom-huntington opened this issue Jan 8, 2022 · 4 comments
Assignees
Labels
area-Dialogs feature proposal New feature proposal product-winui3 WinUI 3 issues team-Controls Issue for the Controls team

Comments

@tom-huntington
Copy link

tom-huntington commented Jan 8, 2022

Proposal: Modern WinUI MessageDialog/MessageBox

I'd like a convent way to display simple error messages to the user as per the MessageDialog API:

winrt::Windows::UI::Popups::MessageDialog dialog(L"Hello MessageDialog" );
dialog.ShowAsync();

Requirements:

  • Define local, Call show() API
  • No Xaml
  • Theme matches the WinUI application theme.
  • Modal top-level child window

Current Alternatives

Currently to use MessageDialog we must first IInitializeWithWindow as per #4167, which is not an out-of-the-box solution. MessageDialog doesn't have a dark theme, and its old Windows 8 theme clashes with the modern WinUI theme.

ContentDialog requires Xaml which is too heavy weight for simple error messages.

Additional Features:

It would be sensible add additional features (such as those of MessageDialog like the ability to add UICommands) that are compatible with a define local, call show() API.

@tom-huntington tom-huntington added the feature proposal New feature proposal label Jan 8, 2022
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Jan 8, 2022
@JaiganeshKumaran
Copy link
Contributor

@tom-huntington ContentDialog can be used without XAML.

ContentDialog dialog;
dialog.Text(L"Hello MessageDialog");
dialog.XamlRoot(Content().XamlRoot() /* Assuming that you're showing from the window */);
dialog.ShowAsync();

@tom-huntington
Copy link
Author

Thanks, that solves my immediate problem of theming issues with MessageDialog.

Still I was expecting a modal top-level child window, and its not as out-of-the-box as MessageDialog.

@zadjii-msft
Copy link
Member

You know, I'm definitely interested in this for microsoft/terminal#4134 as well. I'd rather not have to roll my own window just to host a XAML Island that's just a single ContentDialog. I'll do it, but I'd rather just use a built-in component for this.

@michael-hawker
Copy link
Collaborator

Related to #2848

@StephenLPeters StephenLPeters added area-Dialogs product-winui3 WinUI 3 issues team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Mar 2, 2022
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 product-winui3 WinUI 3 issues team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

6 participants