Passing special dates into Calendar / Date Picker

Is there a way to mark special dates in a calendar, as in example “DatePicker with special dates”, where my special dates wouldn’t be hardcoded as here?
IEnumerable<DateTime> dates = new DateTime[] { DateTime.Today.AddDays(-1), DateTime.Today.AddDays(1) };

Instead I’d like to pass a list of dates as a parameter from the parent page, or by calling a method inside the OnInitializeAsync().
Unfortunately, nothing I tried worked. It seems that calendar gets rendered before the OnInitialized method, and I cannot find the way to re-render it, with the selected dates highlighted.
Any idea if that is even possible, or how to make it work?

    int taskId = 7;

    IEnumerable<DateTime> dates = new List<DateTime>();

    void DateRenderSpecial(DateRenderEventArgs args)
    {
        if (dates.Contains(args.Date))
        {
            args.Attributes.Add("style", "background-color: #ff6d41; border-color: white;");
        }
    }

    protected override async Task OnInitializedAsync()
    {
        dates = await projectService.GetAllScheduledTaskDates(taskId);
    }

You can try invoking StateHasChanged() after setting the dates field.

Thank you @korchev, of course it makes sense to try with StateHasChange(), but I actually just figured out what the real problem was. The condition if (dates.Contains(args.Date)) will only be met if values in dates have time set to the default 00:00:00, which my dates clearly don’t have.
In case someone encounters a similar problem, I solved it by using DateTime.Date property to set all the times in my selected dates to 0 (as I care only for the dates when they’re displayed in a calendar). Works like a charm now!