add ILoadContentAsync
This commit is contained in:
@@ -21,6 +21,8 @@ public partial class RadDialogBase : RadForm
|
|||||||
{
|
{
|
||||||
if (DialogPanel is ILoadContent iLoadContent)
|
if (DialogPanel is ILoadContent iLoadContent)
|
||||||
iLoadContent.LoadContent();
|
iLoadContent.LoadContent();
|
||||||
|
else if (DialogPanel is ILoadContentAsync iLoadContentAsync)
|
||||||
|
Task.Run(iLoadContentAsync.LoadContentAsync).Wait();
|
||||||
|
|
||||||
DialogLoading?.Invoke(new DialogLoadingEventArgs(this));
|
DialogLoading?.Invoke(new DialogLoadingEventArgs(this));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ partial class RadFlyoutBase
|
|||||||
|
|
||||||
if (dialogBase is ILoadContent iLoadContent)
|
if (dialogBase is ILoadContent iLoadContent)
|
||||||
iLoadContent.LoadContent();
|
iLoadContent.LoadContent();
|
||||||
|
else if (dialogBase is ILoadContentAsync iLoadContentAsync)
|
||||||
|
Task.Run(iLoadContentAsync.LoadContentAsync).Wait();
|
||||||
|
|
||||||
foreach (var args in flyoutCreatedHandlers.ToArray())
|
foreach (var args in flyoutCreatedHandlers.ToArray())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ public partial class DialogBase : Form
|
|||||||
{
|
{
|
||||||
if (DialogPanel is ILoadContent iLoadContent)
|
if (DialogPanel is ILoadContent iLoadContent)
|
||||||
iLoadContent.LoadContent();
|
iLoadContent.LoadContent();
|
||||||
|
else if (DialogPanel is ILoadContentAsync iLoadContentAsync)
|
||||||
|
Task.Run(iLoadContentAsync.LoadContentAsync).Wait();
|
||||||
|
|
||||||
DialogLoading?.Invoke(new DialogLoadingEventArgs(this));
|
DialogLoading?.Invoke(new DialogLoadingEventArgs(this));
|
||||||
}
|
}
|
||||||
|
|||||||
6
Pilz.UI/ILoadContentAsync.cs
Normal file
6
Pilz.UI/ILoadContentAsync.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Pilz.UI;
|
||||||
|
|
||||||
|
public interface ILoadContentAsync
|
||||||
|
{
|
||||||
|
Task LoadContentAsync();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user