How can I reference the x:Key for a Telerik style?

3 posts, 0 answers
  1. David
    David avatar
    57 posts
    Member since:
    Apr 2011

    Posted 23 Dec 2011 Link to this post

    Hi,

    I've been browsing the Themes subfolder in the Telerik installation folder and I've noticed that each style for a control is named as follows, for example:
    <Style TargetType="telerik:RadToolTip"       
        x:Key="{telerik:ThemeResourceKey ThemeType=
        external:Office_SilverThemeExternal , ElementType=telerik:RadToolTip}"
         >

    How can I reference the x:Key this style? For example, I want to create a style as follows:
    <Style TargetType="telerik:RadToolTip"
        BasedOn="{StaticReference ResourceKey={telerik:ThemeResourceKey ThemeType=
        external:Office_SilverThemeExternal , ElementType=telerik:RadToolTip}}"
         >

    What do I use for the ResourceKey to reference the Telerik style? The above example fails because I can't define the external namespace. This namespace is defined in the Telerik resource dictionaries as:
        xmlns:external="clr-namespace:Telerik.Windows.Controls.External"
         >

    However there is no "Telerik.Windows.Controls.External" reference to add to my project. What can I use for the ResourceKey?

    Kind regards,
    Dave.
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 26 Dec 2011 Link to this post

    Hi,

     

    Will you please share with us what exactly are you trying to achieve with these styles?
    If you need just a simple style based on any Telerik theme you may use your own key or to mark it as an implicit one which will do the trick. In addition to this I believe that the following forum thread "Applying Telerik Themes to Custom Controls based off Standard WPF Controls" might be of help on that matter. 



    Kind regards,
    Vanya Pavlova
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. David
    David avatar
    57 posts
    Member since:
    Apr 2011

    Posted 27 Dec 2011 Link to this post

    Hi,

    I'm looking to improve my solution in the previous thread by refering directly to the x:Key of the Telerik styles instead of making a static copy of the style which is less maintainable.

    Kind regards,
    Dave.
Back to Top