Pink
所以
Orange
我怎么做? this将用于制作XML组件属性如下:
System.Drawing.Color.(variable)
我可以做到吗?
制定组件接受
<ComponentName color="System.Drawing.Color.(variable)" />
参数。
System.Drawing.Color
:
ComponentName.razor
@using System.Drawing
<div style="background-color: @HexColor; height: 50px; width: 50px;"></div>
@code {
[Parameter]
public Color Color { get; set; }
private string HexColor => ColorTranslator.ToHtml(Color);
}