These components can then use it to issue toast messages. The ToastService will be able to be injected into other components in the application. We are going to create a component called Toast which will react to events invoked by a ToastService. Introduction to server-side Blazor AKA Razor ComponentsĪll of the code in this post is available on my GitHub account.īefore we go any further I just want to give you a quick run down of the solution we will be building.What is Blazor and why is it so exciting?.Just for clarity, for the rest of this article you can assume when I say Blazor it is interchangeable with Razor Components (server-side Blazor).įor those of you who are new to Blazor and want a bit more info first. The best bit, this will all be achieved without using a single line of JavaScript. By the time we're done you'll be able to show 4 different toasts depending on the level of importance (information, success, warning and error). In this post, I'm going to show you how to build toast notifications for your Blazor/Razor Components applications. Two new posts are published every day between 1st December and 25th December. This post is part of the second annual C# advent.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |