We have provided the TValue support in the checked property for the Checkbox component. How to set default type @typeparam TValue = bool in blazor(.razor page)
@using Microsoft.AspNetCore.Components.Web;
@using Microsoft.AspNetCore.Components.Rendering
@inherits BaseComponent;
@implements ICheckBox;
@typeparam TValue = bool;
This is a known issue https://github.com/dotnet/aspnetcore/issues/13619
but work around I do in a project is
public class DateTimePickerComponent : DateTimePickerComponent<DateTime?> { } // default Type value
public class DateTimePickerComponent<T> : BaseSubComponent { .... } // all business here
and in Component I inherts from one of
@inherits DateTimePickerComponent // default type will be DateTime?
@inherits DateTimePickerComponent<DateTime> // this also work
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With