[Feature] Offer Modal Service as a cascading value rather than requiring injection
See original GitHub issueI’ve been wondering recently whether the modal service being injected is the right thing to do. Looking at the designs from the Blazor team, they favour using cascading values to provide global concerns. AuthenticationState being a good example of this.
The proposal is to provide a CascadingModalService
component which can be added at the app level rather than requiring the developer to inject a modal service. Ideally, this would also replace the need for adding the BlazoredModal
component to the MainLayout
.
I’m interested in others thoughts on this. Do you have any scenarios where an injected service is a necessity over a cascading value? Love to get some feedback on this idea.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
ASP.NET Core Blazor cascading values and parameters
Cascading values and parameters provide a convenient way to flow data down a component hierarchy from an ancestor component to any number of ......
Read more >Understanding Cascading Values & Cascading Parameters
In this post I provide an overview of cascading values and cascading parameters, what they are, how you can use them and some...
Read more >How to two way bind a cascading value in Blazor?
You can't do two-way binding with cascading parameters. Cascading means flowing downstream, from parent to child, and not the other way ...
Read more ><CascadingValues> Doesn't work. What's the alternative?
Hi all, After a week of trying to pass variables down through a Wizard type interface through cascading values, I've (and one of...
Read more >Custom Authentication in Blazor WebAssembly - Step-By- ...
The idea behind this is that we will not be directly using the service instance in the view (Razor Components), rather we will...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes @larsk2009 that’s it. It just seems like it would solve several reoccurring setup issues we keep seeing, as you’ve pointed out. Without much of a down side. Unless I’ve missed something 🙂
@chrissainty Thanks for the lightning fast reply. Ok, interesting none the less.
For me personally, who started using asp.net core last year because Blazor came around, it feels more intuitive to inject external things, and I would not expect to access a external service thru a cascading parameter. One more thing for the toolbox when designing services - thanks!