Allow Theme cascading value to pass across rendermode boundaries
As explained by this comment, it would be nice for the Theme cascading value be added by a method in the Blazorise library.
https://github.com/dotnet/aspnetcore/issues/50724#issuecomment-1723892147
I am currently porting components from a Blazor Server App to a Blazor web app and am not able to get the Theme cascading value when defined like this
<Blazorise.ThemeProvider Theme="@theme">
<Router AppAssembly="typeof(App).Assembly">
<Found>...</Found>
<NotFound>...</NotFound>
</Router>
</Blazorise.ThemeProvider>
I had to do something similar with AuthenticationState by calling .AddCascadingAuthenticationState()
https://learn.microsoft.com/en-us/aspnet/core/blazor/security/?view=aspnetcore-8.0#troubleshoot-errors
As far as I can see, the AddCascadingAuthenticationState is only available in .NET 8, which makes it quite limiting. We still must support .NET 6 & 7.
For 2.0 we plan to drop older frameworks so we might consider adding this at that time.