This is a migrated thread and some comments may be shown as answers.

Programatically Accessing Static Resources from RadMenuItem

1 Answer 78 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Brian Sayatovic
Top achievements
Rank 1
Brian Sayatovic asked on 25 Nov 2009, 05:24 PM
I'm trying to achieve something where the Headers for RadMenuItems in my RadContextMenu are selected from a static resource, the key of which derives from a binding.  This will allow me to have an ItemsSource of ICommands, and for each, select a different text for the Header based on a key property I expose on my custom ICommands.

I'm using at attached DependencyProperty, so I have access to the RadMenuItem as a DependencyObject when the DynamicProperty is changed.  However, when I try to access the my resource out of the Resources property of my RadMenuItem, it doesn't exist (I get null).

Yet if I remove my attached DynamicProperty and just bind the header (Header="{Binding Source={StaticResource MyKey}}"), the RadMenuItem is able to find the key.

Is there a way to programatically "find" a resource, starting from a RadMenuItem?

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 26 Nov 2009, 11:46 AM
Hello Brian Sayatovic,

Could you send us sample project demonstrating this problem so that we can investigate it further?

Sincerely yours,
Hristo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Menu
Asked by
Brian Sayatovic
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or