add ILoadContentAsync

This commit is contained in:
2024-11-08 10:50:44 +01:00
parent e884666225
commit dcb4e1c1cf
4 changed files with 12 additions and 0 deletions

View File

@@ -21,6 +21,8 @@ public partial class RadDialogBase : RadForm
{
if (DialogPanel is ILoadContent iLoadContent)
iLoadContent.LoadContent();
else if (DialogPanel is ILoadContentAsync iLoadContentAsync)
Task.Run(iLoadContentAsync.LoadContentAsync).Wait();
DialogLoading?.Invoke(new DialogLoadingEventArgs(this));
}

View File

@@ -54,6 +54,8 @@ partial class RadFlyoutBase
if (dialogBase is ILoadContent iLoadContent)
iLoadContent.LoadContent();
else if (dialogBase is ILoadContentAsync iLoadContentAsync)
Task.Run(iLoadContentAsync.LoadContentAsync).Wait();
foreach (var args in flyoutCreatedHandlers.ToArray())
{

View File

@@ -19,6 +19,8 @@ public partial class DialogBase : Form
{
if (DialogPanel is ILoadContent iLoadContent)
iLoadContent.LoadContent();
else if (DialogPanel is ILoadContentAsync iLoadContentAsync)
Task.Run(iLoadContentAsync.LoadContentAsync).Wait();
DialogLoading?.Invoke(new DialogLoadingEventArgs(this));
}

View File

@@ -0,0 +1,6 @@
namespace Pilz.UI;
public interface ILoadContentAsync
{
Task LoadContentAsync();
}