25 instantiations of EventCallback
Microsoft.AspNetCore.Components (3)
EventCallbackFactory.cs (2)
95return new EventCallback<TValue>(callback.Receiver, callback.Delegate); 203return new EventCallback<TValue>(callback?.Target as IHandleEvent ?? receiver as IHandleEvent, callback);
EventCallbackOfT.cs (1)
16public static readonly EventCallback<TValue> Empty = new EventCallback<TValue>(null, (Action)(() => { }));
Microsoft.AspNetCore.Components.Tests (21)
EventCallbackFactoryTest.cs (1)
301var input = new EventCallback<string>(component, @delegate);
EventCallbackTest.cs (9)
49var callback = new EventCallback<EventArgs>(null, (Action)(() => runCount++)); 281var callback = new EventCallback<EventArgs>(component, (Action)(() => runCount++)); 298var callback = new EventCallback<EventArgs>(component, (Action)(() => runCount++)); 316var callback = new EventCallback<EventArgs>(component, (Action<EventArgs>)((e) => { arg = e; runCount++; })); 335var callback = new EventCallback<EventArgs>(component, (Action<EventArgs>)((e) => { arg = e; runCount++; })); 353var callback = new EventCallback<EventArgs>(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; })); 370var callback = new EventCallback<EventArgs>(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; })); 388var callback = new EventCallback<EventArgs>(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; })); 407var callback = new EventCallback<EventArgs>(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; }));
Rendering\RenderTreeBuilderTest.cs (6)
1274var callback = new EventCallback<string>(null, new Action<string>((s) => { })); 1312var callback = new EventCallback<string>(receiver, new Action<string>((s) => { })); 1332var callback = new EventCallback<string>(receiver, new Action<string>((s) => { })); 1352var callback = new EventCallback<string>(receiver, new Action<string>((s) => { })); 1619var callback = new EventCallback<string>(null, new Action<string>((s) => { })); 1657var callback = new EventCallback<string>(receiver, new Action<string>((s) => { }));
Routing\RouterTest.cs (5)
47_router.OnNavigateAsync = new EventCallback<NavigationContext>(null, OnNavigateAsync); 76_router.OnNavigateAsync = new EventCallback<NavigationContext>(null, OnNavigateAsync); 116_router.OnNavigateAsync = new EventCallback<NavigationContext>(null, OnNavigateAsync); 137_router.OnNavigateAsync = new EventCallback<NavigationContext>(null, OnNavigateAsync); 169_router.OnNavigateAsync = new EventCallback<NavigationContext>(null, OnNavigateAsync);
Microsoft.AspNetCore.Components.Web.Tests (1)
Forms\EditFormTest.cs (1)
265builder.AddComponentParameter(4, "OnValidSubmit", new EventCallback<EditContext>(null, SubmitHandler));
220 references to EventCallback
Aspire.Dashboard (5)
Components\Controls\GridValue.razor.cs (1)
56public EventCallback<bool> IsMaskedChanged { get; set; }
Components\Controls\PropertyGrid.razor.cs (1)
118public EventCallback<TItem> IsValueMaskedChanged { get; set; }
Components\Controls\ResourceSelect.razor.cs (1)
26public EventCallback<SelectViewModel<ResourceTypeDetails>> SelectedResourceChanged { get; set; }
Components\Controls\SummaryDetailsView.razor.cs (1)
36public EventCallback<SummaryDetailsSize> OnResize { get; set; }
Components\Resize\BrowserDimensionWatcher.cs (1)
15public EventCallback<ViewportInformation?> ViewportInformationChanged { get; set; }
Microsoft.AspNetCore.Components (93)
CompilerServices\RuntimeHelpers.cs (4)
34public static EventCallback<T> CreateInferredEventCallback<T>(object receiver, Action<T> callback, T value) 51public static EventCallback<T> CreateInferredEventCallback<T>(object receiver, Func<T, Task> callback, T value) 68public static EventCallback<T> CreateInferredEventCallback<T>(object receiver, EventCallback<T> callback, T value)
EventCallbackFactory.cs (11)
9/// A factory for creating <see cref="EventCallback"/> and <see cref="EventCallback{T}"/> 91public EventCallback<TValue> Create<TValue>(object receiver, EventCallback callback) 105public EventCallback<TValue> Create<TValue>(object receiver, EventCallback<TValue> callback) 119public EventCallback<TValue> Create<TValue>(object receiver, Action callback) 133public EventCallback<TValue> Create<TValue>(object receiver, Action<TValue> callback) 147public EventCallback<TValue> Create<TValue>(object receiver, Func<Task> callback) 161public EventCallback<TValue> Create<TValue>(object receiver, Func<TValue, Task> callback) 177public EventCallback<TValue> CreateInferred<TValue>(object receiver, Action<TValue> callback, TValue value) 191public EventCallback<TValue> CreateInferred<TValue>(object receiver, Func<TValue, Task> callback, TValue value) 201private static EventCallback<TValue> CreateCore<TValue>(object receiver, MulticastDelegate callback)
EventCallbackFactoryBinderExtensions.cs (68)
35public static EventCallback<ChangeEventArgs> CreateBinder( 55public static EventCallback<ChangeEventArgs> CreateBinder( 75public static EventCallback<ChangeEventArgs> CreateBinder( 95public static EventCallback<ChangeEventArgs> CreateBinder( 115public static EventCallback<ChangeEventArgs> CreateBinder( 135public static EventCallback<ChangeEventArgs> CreateBinder( 155public static EventCallback<ChangeEventArgs> CreateBinder( 175public static EventCallback<ChangeEventArgs> CreateBinder( 195public static EventCallback<ChangeEventArgs> CreateBinder( 215public static EventCallback<ChangeEventArgs> CreateBinder( 235public static EventCallback<ChangeEventArgs> CreateBinder( 255public static EventCallback<ChangeEventArgs> CreateBinder( 275public static EventCallback<ChangeEventArgs> CreateBinder( 295public static EventCallback<ChangeEventArgs> CreateBinder( 315public static EventCallback<ChangeEventArgs> CreateBinder( 335public static EventCallback<ChangeEventArgs> CreateBinder( 355public static EventCallback<ChangeEventArgs> CreateBinder( 375public static EventCallback<ChangeEventArgs> CreateBinder( 395public static EventCallback<ChangeEventArgs> CreateBinder( 415public static EventCallback<ChangeEventArgs> CreateBinder( 435public static EventCallback<ChangeEventArgs> CreateBinder( 455public static EventCallback<ChangeEventArgs> CreateBinder( 475public static EventCallback<ChangeEventArgs> CreateBinder( 495public static EventCallback<ChangeEventArgs> CreateBinder( 515public static EventCallback<ChangeEventArgs> CreateBinder( 535public static EventCallback<ChangeEventArgs> CreateBinder( 555public static EventCallback<ChangeEventArgs> CreateBinder( 575public static EventCallback<ChangeEventArgs> CreateBinder( 595public static EventCallback<ChangeEventArgs> CreateBinder( 615public static EventCallback<ChangeEventArgs> CreateBinder( 635public static EventCallback<ChangeEventArgs> CreateBinder( 655public static EventCallback<ChangeEventArgs> CreateBinder( 676public static EventCallback<ChangeEventArgs> CreateBinder( 698public static EventCallback<ChangeEventArgs> CreateBinder( 719public static EventCallback<ChangeEventArgs> CreateBinder( 739public static EventCallback<ChangeEventArgs> CreateBinder( 760public static EventCallback<ChangeEventArgs> CreateBinder( 782public static EventCallback<ChangeEventArgs> CreateBinder( 803public static EventCallback<ChangeEventArgs> CreateBinder( 823public static EventCallback<ChangeEventArgs> CreateBinder( 844public static EventCallback<ChangeEventArgs> CreateBinder( 866public static EventCallback<ChangeEventArgs> CreateBinder( 887public static EventCallback<ChangeEventArgs> CreateBinder( 907public static EventCallback<ChangeEventArgs> CreateBinder( 928public static EventCallback<ChangeEventArgs> CreateBinder( 950public static EventCallback<ChangeEventArgs> CreateBinder( 971public static EventCallback<ChangeEventArgs> CreateBinder( 991public static EventCallback<ChangeEventArgs> CreateBinder( 1012public static EventCallback<ChangeEventArgs> CreateBinder( 1034public static EventCallback<ChangeEventArgs> CreateBinder( 1055public static EventCallback<ChangeEventArgs> CreateBinder( 1075public static EventCallback<ChangeEventArgs> CreateBinder( 1096public static EventCallback<ChangeEventArgs> CreateBinder( 1118public static EventCallback<ChangeEventArgs> CreateBinder( 1139public static EventCallback<ChangeEventArgs> CreateBinder( 1159public static EventCallback<ChangeEventArgs> CreateBinder( 1180public static EventCallback<ChangeEventArgs> CreateBinder( 1202public static EventCallback<ChangeEventArgs> CreateBinder( 1223public static EventCallback<ChangeEventArgs> CreateBinder( 1243public static EventCallback<ChangeEventArgs> CreateBinder( 1264public static EventCallback<ChangeEventArgs> CreateBinder( 1286public static EventCallback<ChangeEventArgs> CreateBinder( 1308public static EventCallback<ChangeEventArgs> CreateBinder<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>( 1329public static EventCallback<ChangeEventArgs> CreateBinder<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>( 1339private static EventCallback<ChangeEventArgs> CreateBinderCore<T>( 1382private static EventCallback<ChangeEventArgs> CreateBinderCoreAsync<T>( 1425private static EventCallback<ChangeEventArgs> CreateBinderCore<T>( 1469private static EventCallback<ChangeEventArgs> CreateBinderCoreAsync<T>(
EventCallbackFactoryEventArgsExtensions.cs (4)
19public static EventCallback<EventArgs> Create(this EventCallbackFactory factory, object receiver, Action<EventArgs> callback) 34public static EventCallback<EventArgs> Create(this EventCallbackFactory factory, object receiver, Func<EventArgs, Task> callback) 49public static EventCallback<ChangeEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<ChangeEventArgs> callback) 64public static EventCallback<ChangeEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<ChangeEventArgs, Task> callback)
EventCallbackOfT.cs (4)
14/// Gets an empty <see cref="EventCallback{TValue}"/>. 16public static readonly EventCallback<TValue> Empty = new EventCallback<TValue>(null, (Action)(() => { })); 22/// Creates the new <see cref="EventCallback{TValue}"/>. 81=> obj is EventCallback<TValue> other
Rendering\RenderTreeBuilder.cs (1)
317public void AddAttribute<TArgument>(int sequence, string name, EventCallback<TArgument> value)
Routing\Router.cs (1)
88[Parameter] public EventCallback<NavigationContext> OnNavigateAsync { get; set; }
Microsoft.AspNetCore.Components.QuickGrid (5)
Infrastructure\EventCallbackSubscribable.cs (3)
14private readonly Dictionary<EventCallbackSubscriber<T>, EventCallback<T>> _callbacks = new(); 21foreach (var callback in _callbacks.Values) 28public void Subscribe(EventCallbackSubscriber<T> owner, EventCallback<T> callback)
Infrastructure\EventCallbackSubscriber.cs (2)
14private readonly EventCallback<T> _handler; 17public EventCallbackSubscriber(EventCallback<T> handler)
Microsoft.AspNetCore.Components.Tests (85)
EventCallbackFactoryBinderExtensionsTest.cs (33)
20var binder = EventCallback.Factory.CreateBinder(component, setter, value); 37var binder = EventCallback.Factory.CreateBinder(component, setter, value); 53var binder = EventCallback.Factory.CreateBinder(component, setter, 17); 72var binder = EventCallback.Factory.CreateBinder(component, setter, value); 89var binder = EventCallback.Factory.CreateBinder(component, setter, value); 106var binder = EventCallback.Factory.CreateBinder(component, setter, value); 125var binder = EventCallback.Factory.CreateBinder(component, setter, value); 144var binder = EventCallback.Factory.CreateBinder(component, setter, value); 163var binder = EventCallback.Factory.CreateBinder(component, setter, value); 182var binder = EventCallback.Factory.CreateBinder(component, setter, value); 201var binder = EventCallback.Factory.CreateBinder(component, setter, value); 220var binder = EventCallback.Factory.CreateBinder(component, setter, value); 239var binder = EventCallback.Factory.CreateBinder(component, setter, value); 258var binder = EventCallback.Factory.CreateBinder(component, setter, value); 277var binder = EventCallback.Factory.CreateBinder(component, setter, value); 296var binder = EventCallback.Factory.CreateBinder(component, setter, value); 315var binder = EventCallback.Factory.CreateBinder(component, setter, value); 334var binder = EventCallback.Factory.CreateBinder(component, setter, value); 353var binder = EventCallback.Factory.CreateBinder(component, setter, value); 372var binder = EventCallback.Factory.CreateBinder(component, setter, value); 391var binder = EventCallback.Factory.CreateBinder(component, setter, value); 410var binder = EventCallback.Factory.CreateBinder(component, setter, value); 430var binder = EventCallback.Factory.CreateBinder(component, setter, value, format); 450var binder = EventCallback.Factory.CreateBinder(component, setter, value, format); 469var binder = EventCallback.Factory.CreateBinder(component, setter, value); 488var binder = EventCallback.Factory.CreateBinder(component, setter, value); 508var binder = EventCallback.Factory.CreateBinder(component, setter, value, format); 528var binder = EventCallback.Factory.CreateBinder(component, setter, value, format); 548var binder = EventCallback.Factory.CreateBinder(component, setter, value); 568var binder = EventCallback.Factory.CreateBinder(component, setter, value); 587var binder = EventCallback.Factory.CreateBinder(component, setter, value); 622var binder = EventCallback.Factory.CreateBinder(component, setter, value, culture: null); 641var binder = EventCallback.Factory.CreateBinder(component, setter, value, CultureInfo.InvariantCulture);
EventCallbackFactoryTest.cs (28)
102var callback = EventCallback.Factory.Create(component, @delegate); 120var callback = EventCallback.Factory.Create(anotherComponent, @delegate); 138var callback = EventCallback.Factory.Create(anotherComponent, @delegate); 153var callback = EventCallback.Factory.Create(component, (Action<string>)null); 221var callback = EventCallback.Factory.Create(component, @delegate); 254var callback = EventCallback.Factory.Create(anotherComponent, @delegate); 272var callback = EventCallback.Factory.Create(anotherComponent, @delegate); 287var callback = EventCallback.Factory.Create(component, (Func<string, Task>)null); 301var input = new EventCallback<string>(component, @delegate); 306var callback = EventCallback.Factory.Create<string>(anotherComponent, input); 322var callback = EventCallback.Factory.Create<string>(component, @delegate); 340var callback = EventCallback.Factory.Create<string>(anotherComponent, @delegate); 358var callback = EventCallback.Factory.Create<string>(anotherComponent, @delegate); 373var callback = EventCallback.Factory.Create<string>(component, (Action)null); 389var callback = EventCallback.Factory.Create<string>(component, @delegate); 407var callback = EventCallback.Factory.Create<string>(anotherComponent, @delegate); 422var callback = EventCallback.Factory.Create<string>(component, (Action<string>)null); 440var callback = EventCallback.Factory.Create<string>(anotherComponent, @delegate); 456var callback = EventCallback.Factory.Create<string>(component, @delegate); 474var callback = EventCallback.Factory.Create<string>(anotherComponent, @delegate); 492var callback = EventCallback.Factory.Create<string>(anotherComponent, @delegate); 507var callback = EventCallback.Factory.Create<string>(component, (Func<Task>)null); 523var callback = EventCallback.Factory.Create<string>(component, @delegate); 541var callback = EventCallback.Factory.Create<string>(anotherComponent, @delegate); 559var callback = EventCallback.Factory.Create<string>(anotherComponent, @delegate); 574var callback = EventCallback.Factory.Create<string>(component, (Func<string, Task>)null); 590var callback = EventCallback.Factory.CreateInferred<string>(component, @delegate, "hi"); 606var callback = EventCallback.Factory.CreateInferred<string>(component, @delegate, "hi");
EventCallbackTest.cs (11)
24var callback = default(EventCallback<EventArgs>); 49var callback = new EventCallback<EventArgs>(null, (Action)(() => runCount++)); 281var callback = new EventCallback<EventArgs>(component, (Action)(() => runCount++)); 298var callback = new EventCallback<EventArgs>(component, (Action)(() => runCount++)); 316var callback = new EventCallback<EventArgs>(component, (Action<EventArgs>)((e) => { arg = e; runCount++; })); 335var callback = new EventCallback<EventArgs>(component, (Action<EventArgs>)((e) => { arg = e; runCount++; })); 353var callback = new EventCallback<EventArgs>(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; })); 370var callback = new EventCallback<EventArgs>(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; })); 388var callback = new EventCallback<EventArgs>(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; })); 407var callback = new EventCallback<EventArgs>(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; }));
RendererTest.cs (1)
5298public EventCallback<DerivedEventArgs> OnClickEventCallbackOfT { get; set; }
Rendering\RenderTreeBuilderTest.cs (11)
1274var callback = new EventCallback<string>(null, new Action<string>((s) => { })); 1293var callback = default(EventCallback<string>); 1312var callback = new EventCallback<string>(receiver, new Action<string>((s) => { })); 1332var callback = new EventCallback<string>(receiver, new Action<string>((s) => { })); 1352var callback = new EventCallback<string>(receiver, new Action<string>((s) => { })); 1619var callback = new EventCallback<string>(null, new Action<string>((s) => { })); 1638var callback = default(EventCallback<string>); 1657var callback = new EventCallback<string>(receiver, new Action<string>((s) => { })); 2007builder.AddAttribute(0, "6", default(EventCallback<string>)); // Replace with a 'silent' EventCallback<string>
RenderTreeDiffBuilderTest.cs (1)
1760tree.AddComponentParameter(1, "MyEventCallbackOfT", EventCallback<int>.Empty);
Microsoft.AspNetCore.Components.Web (32)
Forms\EditForm.cs (3)
76[Parameter] public EventCallback<EditContext> OnSubmit { get; set; } 82[Parameter] public EventCallback<EditContext> OnValidSubmit { get; set; } 88[Parameter] public EventCallback<EditContext> OnInvalidSubmit { get; set; }
Forms\Editor.cs (1)
30[Parameter] public EventCallback<T> ValueChanged { get; set; } = default!;
Forms\InputBase.cs (1)
50[Parameter] public EventCallback<TValue> ValueChanged { get; set; }
Forms\InputFile.cs (1)
26public EventCallback<InputFileChangeEventArgs> OnChange { get; set; }
Forms\InputRadioContext.cs (2)
14public EventCallback<ChangeEventArgs> ChangeEventCallback { get; } 21public InputRadioContext(IInputRadioValueProvider valueProvider, InputRadioContext? parentContext, EventCallback<ChangeEventArgs> changeEventCallback)
Forms\InputRadioGroup.cs (1)
38var changeEventCallback = EventCallback.Factory.CreateBinder<string?>(this, __value => CurrentValueAsString = __value, CurrentValueAsString);
JSComponents\JSComponentInterop.cs (1)
170var x when x.IsGenericType && x.GetGenericTypeDefinition() == typeof(EventCallback<>) => ParameterKind.EventCallbackWithSingleParameter,
Routing\NavigationLock.cs (2)
33public EventCallback<LocationChangingContext> OnBeforeInternalNavigation { get; set; } 53OnBeforeInternalNavigation = (EventCallback<LocationChangingContext>)parameter.Value;
Web\WebEventCallbackFactoryEventArgsExtensions.cs (20)
20public static EventCallback<ClipboardEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<ClipboardEventArgs> callback) 36public static EventCallback<ClipboardEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<ClipboardEventArgs, Task> callback) 52public static EventCallback<DragEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<DragEventArgs> callback) 68public static EventCallback<DragEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<DragEventArgs, Task> callback) 84public static EventCallback<ErrorEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<ErrorEventArgs> callback) 100public static EventCallback<ErrorEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<ErrorEventArgs, Task> callback) 116public static EventCallback<FocusEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<FocusEventArgs> callback) 132public static EventCallback<FocusEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<FocusEventArgs, Task> callback) 148public static EventCallback<KeyboardEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<KeyboardEventArgs> callback) 164public static EventCallback<KeyboardEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<KeyboardEventArgs, Task> callback) 180public static EventCallback<MouseEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<MouseEventArgs> callback) 196public static EventCallback<MouseEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<MouseEventArgs, Task> callback) 211public static EventCallback<PointerEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<PointerEventArgs> callback) 227public static EventCallback<PointerEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<PointerEventArgs, Task> callback) 243public static EventCallback<ProgressEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<ProgressEventArgs> callback) 259public static EventCallback<ProgressEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<ProgressEventArgs, Task> callback) 275public static EventCallback<TouchEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<TouchEventArgs> callback) 291public static EventCallback<TouchEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<TouchEventArgs, Task> callback) 307public static EventCallback<WheelEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<WheelEventArgs> callback) 323public static EventCallback<WheelEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<WheelEventArgs, Task> callback)