Первое, что я уже посмотрел:
https://stackoverflow.com/questions/690 ... me%20toast %20to%20appear%20in
Также
https://github.com/Blazored/Toast/tree/main
Там, где я просмотрел образцы и ReadMe.
Я считаю, что реализовал все, но, очевидно, нет.
Итак, вот код:
MainLayout.Razor
Код: Выделить всё
@inherits LayoutComponentBase
@using Blazored.Toast;
@using Blazored.Toast.Services;
@using Blazored.Toast.Configuration
Код: Выделить всё
using Blazored.Toast;
using MyStuff.Web;
using MyStuff.Web.Components;
var builder = WebApplication.CreateBuilder(args);
// Add service defaults & Aspire components.
builder.AddServiceDefaults();
// Add services to the container.
builder.Services.AddRazorComponents().AddInteractiveServerComponents();
builder.Services.AddOutputCache();
builder.Services.AddBlazoredToast();
...
Код: Выделить всё
Код: Выделить всё
@using System.Data;
@using Blazored.Toast;
@using Blazored.Toast.Services;
@using Blazored.Toast.Configuration;
@attribute [StreamRendering(true)]
@attribute [OutputCache(Duration = 5)]
My STuff
My Stuff
Trying to get Blazored Toast to show up
Подробнее здесь: [url]https://stackoverflow.com/questions/79040945/toast-component-not-working-in-razor-app-c-sharp[/url]
Мобильная версия