Add EventCallback<T>.Empty

This commit is contained in:
Ryan Nowak 2019-07-01 17:34:36 -07:00
parent db8f9ce087
commit 616f15a73e
2 changed files with 7 additions and 1 deletions

View File

@ -205,6 +205,7 @@ namespace Microsoft.AspNetCore.Components
public readonly partial struct EventCallback<T>
{
private readonly object _dummy;
public static readonly Microsoft.AspNetCore.Components.EventCallback<T> Empty;
public EventCallback(Microsoft.AspNetCore.Components.IHandleEvent receiver, System.MulticastDelegate @delegate) { throw null; }
public bool HasDelegate { get { throw null; } }
public System.Threading.Tasks.Task InvokeAsync(T arg) { throw null; }

View File

@ -17,7 +17,7 @@ namespace Microsoft.AspNetCore.Components
public static readonly EventCallbackFactory Factory = new EventCallbackFactory();
/// <summary>
/// Gets an empty <see cref="EventCallback{T}"/>.
/// Gets an empty <see cref="EventCallback"/>.
/// </summary>
public static readonly EventCallback Empty = new EventCallback(null, (Action)(() => { }));
@ -72,6 +72,11 @@ namespace Microsoft.AspNetCore.Components
/// </summary>
public readonly struct EventCallback<T> : IEventCallback
{
/// <summary>
/// Gets an empty <see cref="EventCallback{T}"/>.
/// </summary>
public static readonly EventCallback<T> Empty = new EventCallback<T>(null, (Action)(() => { }));
internal readonly MulticastDelegate Delegate;
internal readonly IHandleEvent Receiver;