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

Applying themes to standard controls via TargetType

2 Answers 86 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 14 Oct 2011, 02:40 PM

Hi,

I have just bought the Silverlight control suit and I am looking at theming. As you don't have a simple text box I will need to use the standard one. In order to apply the theme to the standard controls I do something like this

<TextBox
telerik:StyleManager.Theme="Metro"


This works but it means I have to set the value everything I use the text box. Is there any way to use style setters something like this

<Style TargetType="TextBox">
    <Setter Property="Style" Value="telerik:StyleManager.Theme.Metro"></Setter>
</Style>


If I use this VS is not impressed with me!

Andy Newland

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Vanya Pavlova
Telerik team
answered on 14 Oct 2011, 04:08 PM
Hi Andy,

 

The signature is a bit different - you should mark this style as based on any Telerik theme as shown below:

<Style TargetType="TextBox" telerik:StyleManager.BasedOn="Metro">
  ......
</Style>



Best wishes,
Vanya Pavlova
the Telerik team

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

0
Andy
Top achievements
Rank 1
answered on 14 Oct 2011, 04:18 PM
Thank you very much

Andy
Tags
General Discussions
Asked by
Andy
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Andy
Top achievements
Rank 1
Share this question
or