how to bind colors with DynamicResource syntax for RadHorizontalGauge

1 Answer 44 Views
Gauge
Kevin
Top achievements
Rank 1
Kevin asked on 08 Oct 2024, 06:07 AM | edited on 08 Oct 2024, 06:23 AM

If I bind colors with DynamicResource syntax highlighted in the following example,  the exception "The name 'sender' does not exist in the current context" is thrown ,  do you have any insights for it?  

By the way, if I use StaticResource syntax,  it works properly.

Thanks.

            <telerik:GaugeRange Color="{DynamicResource MyColor}"
                                  From="0"
                                  To="150" />   

1 Answer, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 09 Oct 2024, 08:39 AM

Hi Кevin,

I am afraid you came across a limitation in the Gauge control - dynamic resources are currently not supported. I logged this as a feature request on your behalf in our public feedback portal, you can check it here:

Gauge: Provide a way the GaugeRange's Color to work with DynamicResource

Can you provide more details on the exact Gauge definition you have? I am asking as we can research for a workaround for this, for example using attached properties.

Regards,
Yana
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.

Kevin
Top achievements
Rank 1
commented on 09 Oct 2024, 11:11 AM | edited

Hi Yana,

      Thanks for your feedback.  The detailed definition is as below.

      

Yana
Telerik team
commented on 10 Oct 2024, 07:51 AM

Hi Kevin,

Thank you for sharing the Gauge definition.

I've created a quick example with setting the GaugeRange Color through attached properties, please download the app and give it a try.

I hope it would useful as a temporary solution until we provide built-in support for dynamic resources.

Kevin
Top achievements
Rank 1
commented on 11 Oct 2024, 06:52 AM

Hi Yana,

Thank you for providing the workaround, I will give it a try.

Tags
Gauge
Asked by
Kevin
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or