Applying themes to standard controls via TargetType

3 posts, 1 answers
  1. Andy
    Andy avatar
    16 posts
    Member since:
    Aug 2012

    Posted 14 Oct 2011 Link to this post

    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. Answer
    Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 14 Oct 2011 Link to this post

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

  3. Andy
    Andy avatar
    16 posts
    Member since:
    Aug 2012

    Posted 14 Oct 2011 Link to this post

    Thank you very much

    Andy
Back to Top