Blazorise icon indicating copy to clipboard operation
Blazorise copied to clipboard

Allow Theme cascading value to pass across rendermode boundaries

Open mtbayley opened this issue 1 year ago • 1 comments

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

mtbayley avatar Apr 23 '24 17:04 mtbayley

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.

stsrki avatar Apr 24 '24 14:04 stsrki