@page "/"
@* shape I *@
<RadioButton Shape="I" ShapeChanged="@(() => SetShape("I"))"
Value="@IsIChecked" ValueChanged="@(() => IsIChecked = true)" />
@* shape L *@
<RadioButton Shape="L" ShapeChanged="@(() => SetShape("L"))"
Value="@IsLChecked" ValueChanged="@(() => IsLChecked = true)" />
@* shape U *@
<RadioButton Shape="U" ShapeChanged="@(() => SetShape("U"))"
Value="@IsUChecked" ValueChanged="@(() => IsUChecked = true)" />
@* shape Z *@
<RadioButton Shape="Z" ShapeChanged="@(() => SetShape("Z"))"
Value="@IsZChecked" ValueChanged="@(() => IsZChecked = true)" />
<input type="text" id="unique-id" class="d-inline-block" @bind="Id">
@code {
public static string Shape { get; set; } = "I";
public static bool IsIChecked { get; set; } = true;
public static bool IsLChecked { get; set; } = false;
public static bool IsUChecked { get; set; } = false;
public static bool IsZChecked { get; set; } = false;
public static string Id
{
get => Shape;
set
{
Shape = value.ToUpper();
IsIChecked = false;
IsLChecked = false;
IsUChecked = false;
IsZChecked = false;
if (Shape == "I")
IsIChecked = true;
else if (Shape == "L")
IsLChecked = true;
else if (Shape == "U")
IsUChecked = true;
else if (Shape == "Z")
IsZChecked = true;
}
}
private void SetShape(string shape)
{
Id = shape;
}
}