AvaloniaCommunity / Prism.Avalonia

Prism framework support for Avalonia UI
https://www.nuget.org/packages/Prism.Avalonia/
MIT License
271 stars 36 forks source link

[Enhancement] showDialog in avalonia ui is async,could add a method named showDialogAsync with async tag in dialogService #106

Closed yaobiao131 closed 2 months ago

yaobiao131 commented 7 months ago

Description

ShowDialog in avalonia ui is asynchronous. Should a method named showDialogAsync with an asynchronous tag be added to the dialogService to be compatible with wpf's showdialog?

Context

Add any other context, examples, or screenshots about the feature request here.

Coolkeke commented 2 months ago

It is not recommended to do this as it can cause confusion for developers

DamianSuess commented 2 months ago

(Updated typos) @yaobiao131, in v9.0.x IDialogService will implement an async call. This feature will not be backported. However, you are welcome to derive your own IDialogServiceExtension, check out the PR link below.

public static Task<IDialogResult> ShowDialogAsync(this IDialogService dialogService, string name) { ... }

public static Task<IDialogResult> ShowDialogAsync(this IDialogService dialogService, string name, IDialogParameters parameters) { ... }

With the Prism 9.0.x upgrades the IDialogService interface has moved into the framework's Prism.Core for standardization across the platforms. Check out #129 Prism v9.0.271-pre upgrade