/// Invokes the initialized delegate with the specified <see cref="IDialogResult"/>
/// </summary>
/// <param name="result"></param>
publicasyncvoidInvoke(IDialogResultresult)
{
switch(_callback)
{
caseAction<IDialogParameters>actionCallback:
actionCallback(parameters);
caseAction<IDialogResult>actionCallback:
actionCallback(result);
break;
caseFunc<IDialogParameters,Task>taskCallback:
awaittaskCallback(parameters);
caseFunc<IDialogResult,Task>taskCallback:
awaittaskCallback(result);
break;
default:
thrownewInvalidOperationException("The DialogCloseCallback has not been properly initialized. This must be initialized by the DialogService, and should not be set by user code.");