-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
✔️ Resolution: Won't FixResolved because we decided not to change the behavior reported in this issue.Resolved because we decided not to change the behavior reported in this issue.Status: Resolvedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing one
Milestone
Description
I'm am trying to add a parameter of type "C1Color" I created to a razor component, and I'd like to pass it as a string.
public class C1Border : C1View
{
[Parameter]
private C1Color Color { get; set; }
}
<C1Border Color="#FF0000">
<Component1 />
</C1Border>
Is there any way to use System.ComponentModel.TypeConverter for these scenarios?
[Parameter]
[TypeConverter(typeof(C1ColorTypeConverter))]
private C1Color Color { get; set; }
I know I can do something like this
<C1Border Color="@C1Color.FromHexString("#FF0000")">
<Component1 />
</C1Border>
But I want to avoid it.
Metadata
Metadata
Assignees
Labels
✔️ Resolution: Won't FixResolved because we decided not to change the behavior reported in this issue.Resolved because we decided not to change the behavior reported in this issue.Status: Resolvedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing one