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

Custom Button Theming

1 Answer 98 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Yuri
Top achievements
Rank 1
Yuri asked on 18 Apr 2012, 06:20 AM
Hi There, 

We have a requirement for lots of different buttons with their appropriate look and feel. I have created my own Theme where the buttons would each take on their own style, The required behavior would be to have our own style for each of the buttons, however, if one of your themes were chosen, then it would just use that for each Button Style,

The buttons all inherit from RadButton, However, When we use our own Theme, the buttons look the way they should in design time. eg ButtonType1 =  Green, ButtonType2 = Red, NormalRadButton = Orange. However, when I then run the application all the buttons change to the NormalRadButton of Orange. This would be the required behavior when using a Telerik theme.

I have a small demo app that shows the behavior, however, you don't seem to allow these type of uploads, I have attached screen shots of the demo app, 

I could send you the demo app if required

Thanks,

Yuri

 

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 20 Apr 2012, 08:49 AM
Hi Yuri,

Thank you for sending us a support ticket with a sample solution. It really helped us better understand the case.

I already posted a reply in the support thread, however, in case anyone else encounters the same issue, I will post the information here as well.

At the moment in order to create an implicit style based on a custom theme, you need to use the following syntax:
<Style BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=MyTheme:MyCustomTheme, ElementType=telerik:RadButton}}" TargetType="telerik:RadButton" />
 
<Style BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=MyTheme:MyCustomTheme, ElementType=CustomControlLibrary:FirstLevelButton}}" TargetType="CustomControlLibrary:FirstLevelButton" />

Please give this a try and let us know if it helps.

Kind regards,
Tina Stancheva
the Telerik team

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

Tags
Buttons
Asked by
Yuri
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or