diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
index 8809a6b8..0d494207 100644
--- a/.github/workflows/dotnet.yml
+++ b/.github/workflows/dotnet.yml
@@ -40,7 +40,7 @@ jobs:
- name: Setup NuGet.exe for use with actions
# You may pin to the exact commit or the version.
# uses: NuGet/setup-nuget@fd9fffd6ca4541cf4152a9565835ca1a88a6eb37
- uses: NuGet/setup-nuget@v1.1.1
+ uses: NuGet/setup-nuget@v2
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
@@ -81,5 +81,5 @@ jobs:
run: msbuild ${{env.caliburn_sln}} /t:package /p:Configuration=${{env.build_configuration}}
- name: publish Nuget Packages to GitHub
- run: dotnet nuget publish ${{env.nuget_folder}} --source ${{env.package_feed}} --api-key ${{secrets.PUBLISH_NUGET_PACKAGE}} --skip-duplicate
+ run: dotnet nuget push ${{env.nuget_folder}} --source ${{env.package_feed}} --api-key ${{secrets.PUBLISH_NUGET_PACKAGE}} --skip-duplicate
if: github.event_name != 'pull_request'
diff --git a/src/Caliburn.Micro.Core/AsyncEventHandler.cs b/src/Caliburn.Micro.Core/AsyncEventHandler.cs
index f92776d5..9e76af37 100644
--- a/src/Caliburn.Micro.Core/AsyncEventHandler.cs
+++ b/src/Caliburn.Micro.Core/AsyncEventHandler.cs
@@ -3,6 +3,13 @@
namespace Caliburn.Micro
{
+ ///
+ /// Represents an asynchronous event handler.
+ ///
+ /// The type of the event data generated by the event.
+ /// The source of the event.
+ /// An object that contains the event data.
+ /// A task that represents the asynchronous operation.
public delegate Task AsyncEventHandler(
object sender,
TEventArgs e)
diff --git a/src/Caliburn.Micro.Core/AsyncEventHandlerExtensions.cs b/src/Caliburn.Micro.Core/AsyncEventHandlerExtensions.cs
index c4b2ecaa..32cfd6e1 100644
--- a/src/Caliburn.Micro.Core/AsyncEventHandlerExtensions.cs
+++ b/src/Caliburn.Micro.Core/AsyncEventHandlerExtensions.cs
@@ -5,13 +5,33 @@
namespace Caliburn.Micro
{
+ ///
+ /// AsyncEventHandlerExtensions class.
+ ///
+ ///
+ /// Contains helper functions to run Invoke methods asynchronously.
+ ///
public static class AsyncEventHandlerExtensions
{
+ ///
+ /// Gets the invocation list of the specified async event handler.
+ ///
+ /// The type of the event arguments.
+ /// The async event handler.
+ /// An enumerable of async event handlers.
public static IEnumerable> GetHandlers(
this AsyncEventHandler handler)
where TEventArgs : EventArgs
=> handler.GetInvocationList().Cast>();
+ ///
+ /// Invokes all handlers of the specified async event handler asynchronously.
+ ///
+ /// The type of the event arguments.
+ /// The async event handler.
+ /// The source of the event.
+ /// The event data.
+ /// A task that represents the completion of all handler invocations.
public static Task InvokeAllAsync(
this AsyncEventHandler handler,
object sender,
diff --git a/src/Caliburn.Micro.Platform/Platforms/Maui/Windows/MauiPlatformProvider.cs b/src/Caliburn.Micro.Platform/Platforms/Maui/Windows/MauiPlatformProvider.cs
index 95f11a38..62a77b4b 100644
--- a/src/Caliburn.Micro.Platform/Platforms/Maui/Windows/MauiPlatformProvider.cs
+++ b/src/Caliburn.Micro.Platform/Platforms/Maui/Windows/MauiPlatformProvider.cs
@@ -1,54 +1,48 @@
-namespace Caliburn.Micro.Maui
+namespace Caliburn.Micro.Maui
{
using System;
using System.Collections.Generic;
+ using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
- using System.Reflection;
- using Windows.UI.Core;
- //using Windows.UI.Xaml;
- using Microsoft.UI;
using Microsoft.UI.Xaml;
-
+ using Windows.UI.Core;
///
- /// A implementation for the XAML platfrom.
+ /// A implementation for the .NET MAUI platform.
///
- public class MauiPlatformProvider : IPlatformProvider
+ public class MauiPlatformProvider : IPlatformProvider
{
private readonly CoreDispatcher dispatcher;
-
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
- public MauiPlatformProvider()
+ public MauiPlatformProvider()
{
-
dispatcher = Window.Current?.Dispatcher;
-
}
///
- /// Whether or not classes should execute property change notications on the UI thread.
+ /// Whether or not classes should execute property change notifications on the UI thread.
///
public virtual bool PropertyChangeNotificationsOnUIThread => true;
///
/// Indicates whether or not the framework is in design-time mode.
///
- public virtual bool InDesignMode
+ public virtual bool InDesignMode
{
get { return View.InDesignMode; }
}
- private void ValidateDispatcher()
+ private void ValidateDispatcher()
{
if (dispatcher == null)
throw new InvalidOperationException("Not initialized with dispatcher.");
}
- private bool CheckAccess()
+ private bool CheckAccess()
{
return dispatcher == null || Window.Current != null;
}
@@ -57,7 +51,7 @@ private bool CheckAccess()
/// Executes the action on the UI thread asynchronously.
///
/// The action to execute.
- public virtual void BeginOnUIThread(System.Action action)
+ public virtual void BeginOnUIThread(System.Action action)
{
ValidateDispatcher();
var dummy = dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => action());
@@ -67,23 +61,22 @@ public virtual void BeginOnUIThread(System.Action action)
/// Executes the action on the UI thread asynchronously.
///
/// The action to execute.
- ///
- public virtual Task OnUIThreadAsync(Func action) {
+ /// A task that represents the asynchronous operation.
+ public virtual Task OnUIThreadAsync(Func action)
+ {
ValidateDispatcher();
return dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => action()).AsTask();
-
}
///
/// Executes the action on the UI thread.
///
/// The action to execute.
- ///
- public virtual void OnUIThread(System.Action action)
+ public virtual void OnUIThread(System.Action action)
{
if (CheckAccess())
action();
- else
+ else
{
dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => action()).AsTask().Wait();
}
@@ -93,33 +86,31 @@ public virtual void OnUIThread(System.Action action)
/// Used to retrieve the root, non-framework-created view.
///
/// The view to search.
- ///
- /// The root element that was not created by the framework.
- ///
+ /// The root element that was not created by the framework.
///
/// In certain instances the services create UI elements.
/// For example, if you ask the window manager to show a UserControl as a dialog, it creates a window to host the UserControl in.
/// The WindowManager marks that element as a framework-created element so that it can determine what it created vs. what was intended by the developer.
/// Calling GetFirstNonGeneratedView allows the framework to discover what the original element was.
///
- public virtual object GetFirstNonGeneratedView(object view)
+ public virtual object GetFirstNonGeneratedView(object view)
{
return View.GetFirstNonGeneratedView(view);
}
private static readonly DependencyProperty PreviouslyAttachedProperty = DependencyProperty.RegisterAttached(
"PreviouslyAttached",
- typeof (bool),
- typeof (MauiPlatformProvider),
+ typeof(bool),
+ typeof(MauiPlatformProvider),
null
- );
+ );
///
- /// Executes the handler the fist time the view is loaded.
+ /// Executes the handler the first time the view is loaded.
///
/// The view.
/// The handler.
- public virtual void ExecuteOnFirstLoad(object view, Action