Applying a theme through a style...

6 posts, 0 answers
  1. Kevin Finke
    Kevin Finke avatar
    8 posts
    Member since:
    Jan 2006

    Posted 09 Feb 2011 Link to this post

    We control all of our app's appearance through styles.  I would like to apply a theme to a RadTabControl in this way.  I have:
        
    <telerik:Theme x:Key="Windows7"                           
        Source="/Telerik.Windows.Themes.Windows7;component/themes/generic.xaml" />    



    <
    Style TargetType="telerik:RadTabControl">       
        <
    Setter Property="telerik:StyleManager.Theme" Value="{StaticResource Windows7}"/>       
        <
    Setter Property="VerticalAlignment" Value="Stretch"/>       
        <
    Setter Property="VerticalContentAlignment" Value="Stretch"/>   
    </
    Style>
    However, it doesn't appear to be working. Any suggestions?
  2. Sia
    Admin
    Sia avatar
    745 posts

    Posted 10 Feb 2011 Link to this post

    Hello Kevin Finke,

    Please try to apply it as follows:
    <Style TargetType="telerik:RadTabControl" telerik:StyleManager.Theme={StaticResource Windows7} >          
        <Setter Property="VerticalAlignment" Value="Stretch"/>       
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>   
    </Style>
    and let us know if it works correctly.

    All the best,
    Sia
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. Kevin Finke
    Kevin Finke avatar
    8 posts
    Member since:
    Jan 2006

    Posted 11 Feb 2011 Link to this post

    No, that doesn't appear to work either.  Anything else?  I have:

        <telerik:Theme x:Key="Windows7"         
                       Source="/Telerik.Windows.Themes.Windows7;component/themes/generic.xaml" />

        <Style TargetType="telerik:RadTabControl" telerik:StyleManager.Theme="{StaticResource Windows7}">
            <!--<Setter Property="telerik:StyleManager.Theme" Value="{StaticResource Windows7}"/>-->
            <Setter Property="VerticalAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        </Style>
  4. Sia
    Admin
    Sia avatar
    745 posts

    Posted 16 Feb 2011 Link to this post

    Hello Kevin Finke,

    Can you give us more information about your goal? Do you want to use a custom theme as described in this help topic or you want to base the RadTabControl style on the default one (from the Windows7 theme) and modify it subsequently? or you are trying just to apply the Windows 7 theme as described here?

    Can you please send us a sample project so we can investigate your case in detail? And if possible to modify it in order to work correctly.

    Thank you in advance,
    Sia
    the Telerik team
  5. Kevin Finke
    Kevin Finke avatar
    8 posts
    Member since:
    Jan 2006

    Posted 16 Feb 2011 Link to this post

    Actually, what I wanted was your second link, but I couldn't get it to work that way.  I figured since this was not your average property (StyleManager.Theme), I was looking for a not so simple solution.  However, it turns out the following actually works:

        <Style TargetType="telerik:RadTabControl" >
            <Setter Property="telerik:StyleManager.Theme" Value="Windows7"/>
            <Setter Property="VerticalAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        </Style>



    Go figure!
  6. Sia
    Admin
    Sia avatar
    745 posts

    Posted 17 Feb 2011 Link to this post

    Hello Kevin Finke,

    I am happy that you find the solution you needed. If any other questions arise do not hesitate to contact us again.

    Greetings,
    Sia
    the Telerik team
Back to Top