ChartAdornmentInfo3D Foreground DynamicResource does not update on runtime theme switch for ColumnSeries3D

Hello,

I am defining a SfChart3D ​xaml style that has a target type ColumnSeries3D and the chart control is LineSeries3D, the ChartAdornmentInfo3D.Foreground property does not update when a {DynamicResource} brush changes at runtime. For example when I have a dark theme, the foreground dynamic brush will be a white color, but when I change to a light theme, the foreground dynamic brush becomes a black color. But in this case, when I switch themes during runtime and switch to a different resource dictionary, the foreground color of the ChartAdornmentInfo still is white. I also want to have the label YofTot. 

The same {DynamicResource} does update correctly for other series types (e.g., DoughnutSeries3D) and for normal WPF controls.  Why does this dynamic resource reference for the foreground color work for other 3D chart s but not for this specific chart? Are you able to provide an example in which the LineSeries3D chart has a xaml resource dictionary style that is applied to the LineSeries3D, and can change foreground colors dynamically?


1 Reply

BP Baranibharathi Pandian Syncfusion Team February 4, 2026 11:18 AM UTC

Hi Eric,


We have validated your query and confirmed that we are able to replicate the reported issue. The ChartAdornmentInfo3D.Foreground color does not update at runtime when DynamicResource is used while switching themes dynamically.


This happens because the 3D chart adornment visuals are created during the initial rendering and are not refreshed automatically when the resource dictionary changes. As a result, the adornment labels continue to use the previously applied foreground brush even though the theme resources are updated.


As a workaround, we recommend explicitly reassigning the updated brush to the ChartAdornmentInfo3D.Foreground property after changing the theme and forcing the adornments to refresh. We have shared a code snippet and a sample for your reference.


private void ApplyTheme(string resourcePath)

{

    var rd = new ResourceDictionary { Source = new Uri(resourcePath, UriKind.Relative) };

    Application.Current.Resources.MergedDictionaries.Clear();

    Application.Current.Resources.MergedDictionaries.Add(rd);

 

    var brush = Application.Current.TryFindResource("AdornmentForegroundBrush") as Brush;

 

    if (Chart3D != null && brush != null)

    {

        foreach (var seriesObj in Chart3D.Series)

        {

            try

            {

                dynamic series = seriesObj;

                var adornments = series.AdornmentsInfo as Syncfusion.UI.Xaml.Charts.ChartAdornmentInfo3D;

                if (adornments != null)

                {

                    adornments.Foreground = brush;

                    var current = adornments.ShowLabel;

                    adornments.ShowLabel = false;

                    adornments.ShowLabel = current;

                }

            }

            catch { /* ignore non-adorned series */ }

        }

    }

}


The reported behavior has also been forwarded to our development team for further validation, and we will keep you informed with updates.


Regards,

Baranibharathi P.


Attachment: WPF_SimpleSample_3DChart_38c490c5.zip

Loader.
Up arrow icon