Skip to content

Commit

Permalink
chore: enabling nullability checks
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed Jul 7, 2023
1 parent 550da55 commit 089679d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Prism.Core/Dialogs/DialogCloseEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.ComponentModel;
using System.Threading.Tasks;

#nullable enable
namespace Prism.Dialogs;

/// <summary>
Expand All @@ -16,7 +17,7 @@ public struct DialogCloseEvent
/// </summary>
public DialogCloseEvent()
{
_callback = null;
_callback = () => { };
}

/// <summary>
Expand All @@ -43,16 +44,14 @@ public DialogCloseEvent(Func<IDialogParameters, Task> callback)
/// Invokes the initialized delegate with no <see cref="IDialogParameters"/>.
/// </summary>
public void Invoke() =>
Invoke(null);
Invoke(new DialogParameters());

/// <summary>
/// Invokes the initialized delegate with the specified <see cref="IDialogParameters"/>.
/// </summary>
/// <param name="parameters">The <see cref="IDialogParameters"/>.</param>
public async void Invoke(IDialogParameters parameters)
{
parameters ??= new DialogParameters();

switch(_callback)
{
case Action<IDialogParameters> actionCallback:
Expand Down

0 comments on commit 089679d

Please sign in to comment.