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

Introduce ShowDialogAsync on Form #5917

Closed
Tracked by #10739
KlausLoeffelmann opened this issue Oct 4, 2021 · 3 comments
Closed
Tracked by #10739

Introduce ShowDialogAsync on Form #5917

KlausLoeffelmann opened this issue Oct 4, 2021 · 3 comments
Assignees
Labels
api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation tenet-modernization Modernizing WinForms UI
Milestone

Comments

@KlausLoeffelmann
Copy link
Member

KlausLoeffelmann commented Oct 4, 2021

Rationale

Fluent and responsive desktop UI are not exclusive domains of UWP, WinUi or WPF. WinForm is also capable of this, not only in principle: In order to guarantee fluid WinForms app and to exclude "application not responding" messages, it should also be possible in WinForms to apply the programming paradigm with async and await that is predominant in .NET [Core] anyway.

Showing a modal Dialog asynchronously is an important element in this context.

Proposed API

var dialogResult=await Form1.ShowDialogSync([IWin43Window owner]);
@KlausLoeffelmann KlausLoeffelmann added the api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation label Oct 4, 2021
@dotnet dotnet locked and limited conversation to collaborators Oct 4, 2021
@KlausLoeffelmann KlausLoeffelmann changed the title Introduce ShowDialogAsync on Form [WIP] Introduce ShowDialogAsync on Form Oct 4, 2021
@KlausLoeffelmann
Copy link
Member Author

Locked this for now, since it's work in progress.

@KlausLoeffelmann KlausLoeffelmann changed the title [WIP] Introduce ShowDialogAsync on Form Introduce ShowDialogAsync on Form Jan 9, 2022
@dotnet dotnet unlocked this conversation Jan 9, 2022
@KlausLoeffelmann
Copy link
Member Author

Unlocked. Let's discuss from here.

@janseris
Copy link

What is the added value from this? How does this make application more responsive than the regular call which blocks UI thread during InitializeComponent of the dialog and when it's rendered (because how else would you do it anyways? there is no I/O to be asynchronous here or is it)?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation tenet-modernization Modernizing WinForms UI
Projects
None yet
Development

No branches or pull requests

6 participants