Here is a portion of code. Before I did radio type input I had been using the range type input where Pizza.Size property had had data via @bind="Pizza.Size". But as you see @bind="Pizza.Size" is not working anymore.
<form class="dialog-body"><div><label> Rozmiar: </label><InputRadioGroup @bind-Value="Pizza.Size"> @foreach (var size in Pizza.AllowedValues) {<InputRadio Value="size"/><span class="size-label">@size cm</span> }</InputRadioGroup></div></form><div class="dialog-buttons"><button class="btn btn-secondary mr-auto" @onclick="OnCancel">Anuluj</button><span class="mr-center"> Cena: <span class="price">@(Pizza.GetFormattedTotalPrice())</span></span><button class="btn btn-success ml-auto" @onclick="OnConfirm">Zamów</button></div>@code { [Parameter] public Pizza Pizza { get; set; } [Parameter] public EventCallback OnCancel { get; set; } [Parameter] public EventCallback OnConfirm { get; set; }}Pizza model:
public class Pizza{ public const int DefaultSize = 32; public const int MinimumSize = 28; public const int MaximumSize = 50; public static int[] AllowedValues { get; set; } = { 28, 32, 42, 50 }; ... public int Size { get; set; } public decimal GetBasePrice() { return ((decimal)Size / (decimal)DefaultSize) * Special.BasePrice; } public decimal GetTotalPrice() { return GetBasePrice(); } public string GetFormattedTotalPrice() { return GetTotalPrice().ToString("0.00"); }}