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

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

2 Answers 139 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 2
David asked on 23 Dec 2011, 03:42 PM
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 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 26 Dec 2011, 09:51 AM
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 >>

0
David
Top achievements
Rank 2
answered on 27 Dec 2011, 10:14 AM
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.
Tags
General Discussions
Asked by
David
Top achievements
Rank 2
Answers by
Vanya Pavlova
Telerik team
David
Top achievements
Rank 2
Share this question
or