FillColor - not complied with dynamic resource

1 Answer 108 Views
Top achievements
Rank 1
Daniel asked on 14 Apr 2022, 02:46 PM


Severity	Code	Description	Project	File	Line	Suppression State

Error	XFC0009	No property, BindableProperty, or event found for "FillColor", or mismatching type between value and property.	AutomationClient.MAUI	D:\Applications\AutomationClient\AutomationClient.MAUI\Views\DashboardView.xaml	204	

FillColor="{DynamicResource PrimaryColor}"- not complied
<Color x:Key="PrimaryColor">#03446a</Color>

 <telerikChart:RadCartesianChart Grid.Row="5" Grid.Column="0" x:Name="totalFilesDividedByRoutesChart" Margin="10" >
                            <telerikChart:PaletteEntry FillColor="{DynamicResource PrimaryColor}" StrokeColor="{DynamicResource PrimaryColor}" />
                    <telerikChart:CategoricalAxis PlotMode="OnTicks"/>
                    <telerikChart:NumericalAxis LabelFitMode="MultiLine" LabelFormat="N0"  Minimum="0" />
                    <telerikChart:BarSeries ValueBinding="Value"
                                    ItemsSource="{Binding TotalFilesDividedByRoutesDataSource}"/>
                    <telerikChart:CartesianChartGrid StripLinesVisibility="X"
                                       MajorLineThickness="3" />
                    <telerikChart:ChartTooltipBehavior />
            </telerikChart:RadCartesianChart >

1 Answer, 1 is accepted

Sort by
Lance | Manager Technical Support
Telerik team
answered on 14 Apr 2022, 03:09 PM

Hello Daniel,

FillColor is not a DependencyProperty, so this exception is expected in .NET. Change it to a StaticResource instead.

To be more specific to what I think you're attempting to do, you cannot dynamically update at runtime after the chart is rendered. This is a situation because of the nature of the native chart controls, they each have different capabilities when it comes to these options and cannot use a dynamically changing property.

If you want to dynamically change the value, you need to instead Remove and Add the PalleteEntry itself from your custom ChartPallete


// your newly created pallete entry
var nextEntry = ...;


If you need to stick to MVVM, you can do this in a custom-built behavior. If you can do this in code-behind  or some code-behind method that will replace the pallete entry as a whole. after this PaletteEntry is updated, you can then re-render the series to adopt the new coloring.

We do not have an example of a custom built-behavior,  you can learn how to do this here  

Ultimately, at this time, we do not have an official feature that will let you dynamically change FillColor with a DynamicResource. This is a known feature request and is on our backlog.

Lance | Manager Technical Support
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Asked by
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Share this question