Given a \'default\' Blazor app - created using the Visual Studio 2019 Blazor server template. How do you create a GLOBAL object that is acc
There is two ways of doing this.
CascadingParameter
and "State Container" that are very well explained in this article.
Between CascadingParameter
and "State Container", you are the one that should know how your application works and decide what to do.
Probably state container would be better for something like GLOBAL object that is accessible from all the razor pages and components
.
Use [Parameters]?
Instead of passing all parameters down to components, you should use CascadingParameter
Create a Static Class ?
Instead of creating a static class, you should use "State Container"