Custom Button Theming

2 posts, 0 answers
  1. Yuri
    Yuri avatar
    2 posts
    Member since:
    Apr 2012

    Posted 18 Apr 2012 Link to this post

    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



  2. Tina Stancheva
    Tina Stancheva avatar
    3298 posts

    Posted 20 Apr 2012 Link to this post

    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 >>

  3. DevCraft banner
Back to Top