Programatically Accessing Static Resources from RadMenuItem

2 posts, 0 answers
  1. Brian Sayatovic
    Brian Sayatovic avatar
    91 posts
    Member since:
    Nov 2009

    Posted 25 Nov 2009 Link to this post

    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?
  2. Hristo
    Hristo avatar
    832 posts

    Posted 26 Nov 2009 Link to this post

    Hello Brian Sayatovic,

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

    Sincerely yours,
    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.
Back to Top