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

Generics in Blazor component

$
0
0

I am writing a component that requries a generic parameter to be declared. I do not have my code in the page within a code block, but instead use a partial class.

All the examples I've found show that in the page it takes the form:

@typeparam TItem;@code {    [Parameter]    public TItem ExampleList { get; set; }....

how can I declare this using a class file? If I declare typeparam in the page and place my parameter declaration in the partial class, 'TItem' is not recognised. and I do not seem to be able to declare typeparam in the code behind.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



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