Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

1
Vote

Hi!

I'm building an application where the user can switch between light and dark modes, but I can't make StockChart to rerender with the updated theme.


My component:

<SfStockChart Theme=@Theme @ref=@Chart>

...

</SfStockChart>


@code

{

    SfStockChart Chart;


    [Inject]

    public ThemeService ThemeService { get; set; }


    private Theme Theme { get; set; }


    protected override void OnInitialized()

    {

        Theme = ThemeService.RenderedTheme == "light" ? Theme.Material : Theme.MaterialDark;

        ThemeService.ChangeEvent += OnThemeChange;

    }


    private async Task OnThemeChange()

    {

        Theme = ThemeService.RenderedTheme == "light" ? Theme.Material : Theme.MaterialDark;

        await InvokeAsync(() => { StateHasChanged(); });

    }

}


But after the theme change the chart does not update.


Thanks for the help.