5 instantiations of EventCallback
Microsoft.AspNetCore.Components (4)
EventCallback.cs (1)
21public static readonly EventCallback Empty = new EventCallback(null, (Action)(() => { }));
EventCallbackFactory.cs (1)
198return new EventCallback(callback?.Target as IHandleEvent ?? receiver as IHandleEvent, callback);
EventCallbackOfT.cs (1)
67return new EventCallback(Receiver ?? Delegate?.Target as IHandleEvent, Delegate);
RenderTree\Renderer.cs (1)
738_eventBindings.Add(id, (renderedByComponentId, new EventCallback(@delegate.Target as IHandleEvent, @delegate), frame.AttributeName));
Microsoft.AspNetCore.Components.Web (1)
JSComponents\JSComponentInterop.cs (1)
187return new(null, callback);
143 references to EventCallback
Aspire.Dashboard (39)
Components\Controls\AspireMenu.razor.cs (1)
49public EventCallback OnSecondaryActionComplete { get; set; }
Components\Controls\IconCheckbox.razor.cs (1)
55public EventCallback OnClick { get; set; }
Components\Controls\PropertyValues\TraceIdButtonValue.razor.cs (1)
18public EventCallback OnClick { get; set; }
Components\Controls\ResourceActions.razor.cs (1)
69EventCallback.Factory.Create(this, () => OnViewDetails.InvokeAsync(_menuButton?.MenuButtonId)),
Components\Controls\ResourceDetails.razor.cs (1)
299EventCallback.Empty, // View details not shown since we're already in the details view
Components\Controls\SpanActions.razor.cs (1)
38EventCallback.Factory.Create(this, () => OnViewDetails.InvokeAsync(_menuButton?.MenuButtonId)),
Components\Controls\SpanDetails.razor.cs (2)
24public EventCallback CloseCallback { get; set; } 101EventCallback.Empty,
Components\Controls\StructuredLogActions.razor.cs (1)
34EventCallback.Factory.Create(this, () => OnViewDetails.InvokeAsync(_menuButton?.MenuButtonId)));
Components\Controls\StructuredLogDetails.razor.cs (2)
20public EventCallback CloseCallback { get; set; } 138StructuredLogMenuBuilder.AddMenuItems(_logActionsMenuItems, ViewModel.LogEntry, EventCallback.Empty, showViewDetails: false);
Components\Controls\SummaryDetailsView.razor.cs (1)
33public EventCallback OnDismiss { get; set; }
Components\Dialogs\NotificationEntryComponent.razor.cs (1)
17public EventCallback OnDismiss { get; set; }
Components\Interactions\InteractionsProvider.cs (2)
167dialogParameters.OnDialogResult = EventCallback.Factory.Create<DialogResult>(this, async dialogResult => 610return EventCallback.Factory.Create<DialogResult>(this, async dialogResult =>
Components\Layout\AspirePageContentLayout.razor.cs (1)
103OnDialogClosing = EventCallback.Factory.Create<IDialogInstance>(this, async () =>
Components\Layout\MainLayout.razor.cs (4)
341OnDialogClosing = EventCallback.Factory.Create<IDialogInstance>(this, _ => HandleDialogClose(GetVisibleReturnFocusElementId(returnFocusElementId, HelpButtonId))) 399OnDialogClosing = EventCallback.Factory.Create<IDialogInstance>(this, _ => HandleDialogClose()) 423OnDialogClosing = EventCallback.Factory.Create<IDialogInstance>(this, _ => HandleDialogClose(GetVisibleReturnFocusElementId(returnFocusElementId, SettingsButtonId))) 448OnDialogClosing = EventCallback.Factory.Create<IDialogInstance>(this, _ => HandleDialogClose())
Components\Pages\ConsoleLogs.razor.cs (3)
534EventCallback.Factory.Create<bool>(this, async 577EventCallback.Factory.Create(this, () => 582EventCallback.Factory.Create<CommandViewModel>(this, ExecuteResourceCommandAsync),
Components\Pages\Resources.razor.cs (7)
42private EventCallback _onToggleCollapseAllCallback; 43private EventCallback _onToggleResourceTypeCallback; 205_onToggleCollapseAllCallback = EventCallback.Factory.Create(this, OnToggleCollapseAll); 206_onToggleResourceTypeCallback = EventCallback.Factory.Create(this, OnToggleResourceType); 548EventCallback.Factory.Create<bool>( 663EventCallback.Factory.Create(this, () => ShowResourceDetailsAsync(resource, focusElementId)), 664EventCallback.Factory.Create<CommandViewModel>(this, (command) => ExecuteResourceCommandAsync(resource, command)),
Components\Pages\Terminals.razor.cs (3)
245EventCallback.Factory.Create<bool>(this, async showHidden => 263EventCallback.Factory.Create(this, () => NavigationManager.NavigateTo(DashboardUrls.ResourcesUrl(resource: resource.Name))), 264EventCallback.Factory.Create<CommandViewModel>(this, ExecuteResourceCommandAsync),
Model\DashboardDialogService.cs (1)
105return EventCallback.Factory.Create(receiver, callback);
Model\ResourceMenuBuilder.cs (1)
70EventCallback onViewDetails,
Model\SpanMenuBuilder.cs (1)
57EventCallback onViewDetails,
Model\StructuredLogMenuBuilder.cs (3)
55EventCallback onViewDetails, 71EventCallback onViewDetails, 81EventCallback onViewDetails,
Aspire.Dashboard.Components.Tests (9)
Controls\AspireMenuTests.cs (1)
149builder.Add(p => p.OpenChanged, EventCallback.Factory.Create<bool>(this, openChanges.Add));
Controls\ChartFiltersTests.cs (1)
360builder.Add(p => p.OnDimensionValuesChanged, EventCallback.Factory.Create(this, onDimensionValuesChanged));
Controls\ResourceDetailsTests.cs (3)
759builder.Add(p => p.CommandSelected, EventCallback.Factory.Create<CommandViewModel>(this, c => capturedCommand = c)); 805builder.Add(p => p.CommandSelected, EventCallback.Factory.Create<CommandViewModel>(this, c => capturedCommand = c)); 850builder.Add(p => p.CommandSelected, EventCallback.Factory.Create<CommandViewModel>(this, _ => Task.CompletedTask));
Model\DashboardDialogServiceTests.cs (2)
90OnDialogClosing = EventCallback.Factory.Create<IDialogInstance>(this, async _ => 95OnDialogResult = EventCallback.Factory.Create<DialogResult>(this, async _ =>
Pages\ResourcesTests.cs (2)
185builder.Add(component => component.CommandSelected, EventCallback.Factory.Create<CommandViewModel>(this, _ => Task.CompletedTask)); 187builder.Add(component => component.OnViewDetails, EventCallback.Factory.Create<string?>(this, _ => Task.CompletedTask));
Aspire.Dashboard.Tests (10)
Model\ResourceMenuBuilderTests.cs (10)
99EventCallback.Empty, 151EventCallback.Empty, 186EventCallback.Empty, 239EventCallback.Empty, 277EventCallback.Empty, 312EventCallback.Empty, 360EventCallback.Empty, 400EventCallback.Empty, 443EventCallback.Empty, 486EventCallback.Empty,
Microsoft.AspNetCore.Components (51)
CompilerServices\RuntimeHelpers.cs (3)
36return EventCallback.Factory.Create<T>(receiver, callback); 53return EventCallback.Factory.Create<T>(receiver, callback); 70return EventCallback.Factory.Create<T>(receiver, callback);
EventCallback.cs (4)
19/// Gets an empty <see cref="EventCallback"/>. 21public static readonly EventCallback Empty = new EventCallback(null, (Action)(() => { })); 27/// Creates the new <see cref="EventCallback"/>. 81=> obj is EventCallback other
EventCallbackFactory.cs (27)
9/// A factory for creating <see cref="EventCallback"/> and <see cref="EventCallback{T}"/> 21public EventCallback Create(object receiver, EventCallback callback) 29/// Creates an <see cref="EventCallback"/> for the provided <paramref name="receiver"/> and 34/// <returns>The <see cref="EventCallback"/>.</returns> 35public EventCallback Create(object receiver, Action callback) 43/// Creates an <see cref="EventCallback"/> for the provided <paramref name="receiver"/> and 48/// <returns>The <see cref="EventCallback"/>.</returns> 49public EventCallback Create(object receiver, Action<object> callback) 57/// Creates an <see cref="EventCallback"/> for the provided <paramref name="receiver"/> and 62/// <returns>The <see cref="EventCallback"/>.</returns> 63public EventCallback Create(object receiver, Func<Task> callback) 71/// Creates an <see cref="EventCallback"/> for the provided <paramref name="receiver"/> and 76/// <returns>The <see cref="EventCallback"/>.</returns> 77public EventCallback Create(object receiver, Func<object, Task> callback) 91public EventCallback<TValue> Create<TValue>(object receiver, EventCallback callback) 113/// Creates an <see cref="EventCallback"/> for the provided <paramref name="receiver"/> and 118/// <returns>The <see cref="EventCallback"/>.</returns> 127/// Creates an <see cref="EventCallback"/> for the provided <paramref name="receiver"/> and 132/// <returns>The <see cref="EventCallback"/>.</returns> 141/// Creates an <see cref="EventCallback"/> for the provided <paramref name="receiver"/> and 146/// <returns>The <see cref="EventCallback"/>.</returns> 155/// Creates an <see cref="EventCallback"/> for the provided <paramref name="receiver"/> and 160/// <returns>The <see cref="EventCallback"/>.</returns> 169/// Creates an <see cref="EventCallback"/> for the provided <paramref name="receiver"/> and 183/// Creates an <see cref="EventCallback"/> for the provided <paramref name="receiver"/> and 196private static EventCallback CreateCore(object receiver, MulticastDelegate callback)
EventCallbackFactoryBinderExtensions.cs (1)
11/// Contains extension methods for two-way binding using <see cref="EventCallback"/>. For internal use only.
EventCallbackFactoryEventArgsExtensions.cs (8)
12/// Creates an <see cref="EventCallback"/> for the provided <paramref name="receiver"/> and 18/// <returns>The <see cref="EventCallback"/>.</returns> 27/// Creates an <see cref="EventCallback"/> for the provided <paramref name="receiver"/> and 33/// <returns>The <see cref="EventCallback"/>.</returns> 42/// Creates an <see cref="EventCallback"/> for the provided <paramref name="receiver"/> and 48/// <returns>The <see cref="EventCallback"/>.</returns> 57/// Creates an <see cref="EventCallback"/> for the provided <paramref name="receiver"/> and 63/// <returns>The <see cref="EventCallback"/>.</returns>
EventCallbackOfT.cs (1)
65internal EventCallback AsUntyped()
Rendering\RenderTreeBuilder.cs (3)
263/// Appends a frame representing an <see cref="EventCallback"/> attribute. 277public void AddAttribute(int sequence, string name, EventCallback value) 307/// Appends a frame representing an <see cref="EventCallback"/> attribute.
RenderTree\Renderer.cs (3)
38private readonly Dictionary<ulong, (int RenderedByComponentId, EventCallback Callback, string? attributeName)> _eventBindings = new(); 722if (frame.AttributeValueField is EventCallback callback) 782private (int RenderedByComponentId, EventCallback Callback, string? attributeName) GetRequiredEventBindingEntry(ulong eventHandlerId)
RenderTree\RenderTreeDiffBuilder.cs (1)
1017if ((newFrame.AttributeValueField is MulticastDelegate || newFrame.AttributeValueField is EventCallback) &&
Microsoft.AspNetCore.Components.AI (4)
Components\MessageInput.cs (3)
98EventCallback.Factory.Create<ChangeEventArgs>( 109EventCallback.Factory.Create<KeyboardEventArgs>(this, OnKeyDown)); 126EventCallback.Factory.Create(this, SubmitAsync));
Components\MessageList.cs (1)
171EventCallback.Factory.Create(this,
Microsoft.AspNetCore.Components.Endpoints (1)
src\aspnetcore\src\Components\Shared\src\RenderFragmentSerializer.cs (1)
385if (value is EventCallback)
Microsoft.AspNetCore.Components.Media (4)
FileDownload.cs (4)
54context.Initialize(r => Element = r, EventCallback.Factory.Create(this, OnClickAsync)); 74builder.AddAttribute(4, "onclick", EventCallback.Factory.Create(this, OnClickAsync)); 160private EventCallback _onClick; 161internal void Initialize(Action<ElementReference> capture, EventCallback onClick)
Microsoft.AspNetCore.Components.QuickGrid (12)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\ColumnBase_razor.g.cs (3)
120__builder.AddAttribute(5, "onclick", global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 199__builder.AddAttribute(19, "onclick", global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 307__builder.AddAttribute(44, "onclick", global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this,
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Paginator_razor.g.cs (4)
319__builder.AddAttribute(69, "onclick", global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 345__builder.AddAttribute(78, "onclick", global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 400__builder.AddAttribute(99, "onclick", global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 426__builder.AddAttribute(108, "onclick", global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this,
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\QuickGrid_razor.g.cs (3)
170__builder3.AddAttribute(13, "onclosecolumnoptions", global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::System.EventArgs>(this, 506var rowClick = OnRowClick.HasDelegate ? EventCallback.Factory.Create<MouseEventArgs>(this, () => OnRowClick.InvokeAsync(item)) : default; 532__builder.AddAttribute(44, "onclick", global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this,
QuickGrid.razor.cs (2)
238_currentPageItemsChanged = new(EventCallback.Factory.Create<PaginationState>(this, RefreshDataCoreAsync)); 251EventCallback.Factory.Create<object?>(this, RefreshDataCoreAsync));
Microsoft.AspNetCore.Components.Server (1)
src\aspnetcore\src\Components\Shared\src\RenderFragmentSerializer.cs (1)
385if (value is EventCallback)
Microsoft.AspNetCore.Components.Web (11)
Forms\InputCheckbox.cs (1)
46builder.AddAttribute(8, "onchange", EventCallback.Factory.CreateBinder<bool>(this, __value => CurrentValue = __value, CurrentValue));
Forms\InputDate.cs (1)
93builder.AddAttribute(7, "onchange", EventCallback.Factory.CreateBinder<string?>(this, __value => CurrentValueAsString = __value, CurrentValueAsString));
Forms\InputHidden.cs (1)
32builder.AddAttribute(7, "onchange", EventCallback.Factory.CreateBinder<string?>(this, __value => CurrentValueAsString = __value, CurrentValueAsString));
Forms\InputNumber.cs (1)
62builder.AddAttribute(8, "onchange", EventCallback.Factory.CreateBinder<string?>(this, __value => CurrentValueAsString = __value, CurrentValueAsString));
Forms\InputRadioGroup.cs (1)
38var changeEventCallback = EventCallback.Factory.CreateBinder<string?>(this, __value => CurrentValueAsString = __value, CurrentValueAsString);
Forms\InputSelect.cs (2)
51builder.AddAttribute(7, "onchange", EventCallback.Factory.CreateBinder<string?[]?>(this, SetCurrentValueAsStringArray, default)); 57builder.AddAttribute(9, "onchange", EventCallback.Factory.CreateBinder<string?>(this, __value => CurrentValueAsString = __value, default));
Forms\InputText.cs (1)
40builder.AddAttribute(6, "onchange", EventCallback.Factory.CreateBinder<string?>(this, __value => CurrentValueAsString = __value, CurrentValueAsString));
Forms\InputTextArea.cs (1)
40builder.AddAttribute(6, "onchange", EventCallback.Factory.CreateBinder<string?>(this, __value => CurrentValueAsString = __value, CurrentValueAsString));
JSComponents\JSComponentInterop.cs (2)
178var x when x == typeof(EventCallback) => ParameterKind.EventCallbackWithNoParameters, 183private static EventCallback CreateEventCallbackWithNoParameters(IJSObjectReference? jsObjectReference)
Microsoft.AspNetCore.Components.WebAssembly (1)
src\aspnetcore\src\Components\Shared\src\RenderFragmentSerializer.cs (1)
385if (value is EventCallback)