Explicit styles in custom theme

2 posts, 0 answers
  1. Ross
    Ross avatar
    2 posts
    Member since:
    Oct 2011

    Posted 19 Oct 2011 Link to this post

    I've created a custom theme using the 'Telerik approach' that is laid out in the documentation. This works great for implicit theming of the controls, but if I want to include explicit styles (styles with a x:Key) is that possible? I would really like to have these styles included in a compiled assembly.

    Thanks,
    Ross
  2. Dani
    Admin
    Dani avatar
    848 posts

    Posted 20 Oct 2011 Link to this post

    Hi Ross,

    Basically, a style would override any theme applied to the control, regardless of whether the style is explicit or implicit. But what you can do is try basing your style on your custom theme.

    Please, consider the following xaml snippet in App.xaml:

    <Application
        x:Class="SilverlightApplication3.App"
        xmlns:local="clr-namespace:SilverlightApplication3">
        <Application.Resources>     
            <local:CustomTheme x:Key="Theme" />     
            <Style x:Key="MyCustomButtonStyle" TargetType="telerik:RadButton" telerik:StyleManager.BasedOn="{StaticResource Theme}" />
              
        </Application.Resources>
    </Application>

    I hope this will help you achieve your goal. If you need further assistance on theming, please let me know.


    All the best,
    Dani
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top