Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How to pass type parameter to Body() when render fragment?

$
0
0

I have a project with a UserBase and several applications with different user types wich inherit from the userBase. I pretend to use the differents users for all my razor views instead the UserBase. For that, Im passing the type in the way below through the views:

@typeparam UserType where UserType : class, IUserBase

The problem I have is when I need to pass this type to the @Body wich I want to render, in this case, in the MainLayout.razor:

@typeparam UserType where UserType : class, IUserBase<PageTitle>ApplicationName</PageTitle> <AuthorizeView><div class='layout-wrapper layout-content-navbar'><div class='layout-container'><div class="layout-page"><div class="content-wrapper"><div class='container-xxl flex-grow-1 container-p-y' id="HispaCoreBlazor_MainLayout_ContentWrapper">                  **@Body  **              </div><div class="content-backdrop fade"></div></div></div></div><div class="layout-overlay layout-menu-toggle"></div><div class="drag-target"></div></div></AuthorizeView>

Ive been trying with CascadeParameter but does not allow types, only objects.

Really appreciate any help.Thank you in advance.

Ive been trying with CascadeParameter but does not allow types, only objects.

Really appreciate any help. Thank you in advance.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>