So i have 2 date boxes on a pop up and the second date box is linked to the first where when you select a date in the first the second will show a date 1 month in the future then you can up a duration from a drop down and the second date should continue to change. now i wanted to break that out into some custom components to keep diffrent pages feeling consistant so i tried breaking the whole control into a custom control as shown bellow
@using Microsoft.AspNetCore.Components.Forms
<div class="@MainClass">
<div class="d-flex align-items-center">
<label class="me-2" style="width: 150px;">@ChildContent</label>
<div class="flex-grow-1 d-flex align-items-center">
<div class="input-group">
<InputDate @bind-Value="Value" class="form-control" placeholder="d/M/yy" disabled="@Disabled" />
</div>
@if (!string.IsNullOrWhiteSpace(ToolTipText))
{
<ToolTipInfo>@ToolTipText</ToolTipInfo>
}
</div>
</div>
@if (!string.IsNullOrWhiteSpace(HelpTextText))
{
<HelpText>If this is empty the repayment plan is still ongoing.</HelpText>
}
</div>
@code {
[Parameter] public string? Mb { get; set; } = "3";
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
[Parameter] public DateTime Value { get; set; }
[Parameter] public bool Disabled { get; set; } = false;
[Parameter] public string? HelpTextText { get; set; }
[Parameter] public string? ToolTipText { get; set; }
[Parameter] public EventCallback<DateTime> ValueChanged { get; set; }
private string MainClass => $"mb-{Mb}";
async Task UpdateValue()
{
await ValueChanged.InvokeAsync(Value);
}
}
But now when i implement it when i change the first date the second date dose not change
Iv tried loads of changes to the binding but nothing seams to make the second date change
UpdateValueis never called in the code you are showing.