Blazored / Toast

A JavaScript free toast library for Blazor and Razor Component applications
https://blazored.github.io/Toast/
MIT License
663 stars 92 forks source link

how can I change the header of the toasts now #185

Closed likquietly closed 1 year ago

likquietly commented 1 year ago

Before version 4.0.0 i can use method overload like this to change header: ToastService.ShowWarning($"Some Message", "Header"); But now the same code gives me an exception: Error CS1503 Argument 2: cannot convert from 'string' to 'System.Action?'. How can I can change the header of the toasts with this action delegate?

chrissainty commented 1 year ago

The design of the toasts was changed in v4 and the header isn't there anymore. If you want to have a header in your toasts, you will need to implement a custom toast. That way you can have whatever design you wish. You can find any example in the samples:

https://github.com/Blazored/Toast/blob/3d4da2ff5d0a10139e0c8f320b1be41cb5187658/samples/BlazorWebAssembly/Pages/Index.razor#L23