How to apply a theme to a non-rad control?

12 posts, 2 answers
  1. Wagner
    Wagner avatar
    17 posts
    Member since:
    Feb 2010

    Posted 28 Apr 2010 Link to this post

    Hi,

    I'm using RadControls for WPF 2010 Q1 and I'm trying to apply a theme to non-rad controls.  How can I accomplish that?  I tried to use the 'StyleManager.Theme' property, but that seems to "hide" the control instead of applying the theme.

    Here is the xaml snippet:

            <StatusBar DockPanel.Dock="Bottom" telerik:StyleManager.Theme="Office_Blue"
                <StatusBar.ItemsPanel> 
                    <ItemsPanelTemplate> 
                        <Grid> 
                            <Grid.ColumnDefinitions> 
                                <ColumnDefinition Width="*"/> 
                                <ColumnDefinition Width="Auto"/> 
                            </Grid.ColumnDefinitions> 
                        </Grid> 
                    </ItemsPanelTemplate> 
                </StatusBar.ItemsPanel> 
                <TextBlock>Left Side</TextBlock> 
                <StatusBarItem Grid.Column="1"
                    <TextBlock>Right Side</TextBlock> 
                </StatusBarItem> 
            </StatusBar> 
     

    Thanks in advance,

    Wagner
  2. Answer
    Pana
    Admin
    Pana avatar
    748 posts

    Posted 29 Apr 2010 Link to this post

    Hello Wagner,

    Telerik themes can be applied to non telerik controls but not all controls have defined styles in our themes. You can use our styles with: Button, ScrollBar, ScrollViewer, ListBox, CheckBox and RadioButton. I think there are no other non-Telerik styles.

    Greetings,
    Panayot
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Wagner
    Wagner avatar
    17 posts
    Member since:
    Feb 2010

    Posted 29 Apr 2010 Link to this post

    Hi Panayot,

    Thanks for your reply.

    Are there any plans to provide styles to other standard Microsoft controls in the future?

    Thanks in advance,

    Wagner
  4. Answer
    Pana
    Admin
    Pana avatar
    748 posts

    Posted 29 Apr 2010 Link to this post

    Hi Wagner,

    At this point we don't plan themes for other non-Telerik controls. We will consider the request for expanding our themes but I believe it won't be anytime soon.

    Best wishes,
    Panayot
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. William Baker
    William Baker avatar
    2 posts
    Member since:
    Nov 2007

    Posted 17 Jun 2010 Link to this post

    What about label or texblock controls?
  6. Pana
    Admin
    Pana avatar
    748 posts

    Posted 17 Jun 2010 Link to this post

    Hi William Baker,

    We will not create themes for TextBlock or Label since they can be fully customized through Properties (Foreground, FontSize etc.) and their default values usually fit well with our themes.

    Greetings,
    Panayot
    the Telerik team
     
  7. Andrew Thompson
    Andrew Thompson avatar
    29 posts
    Member since:
    Jan 2010

    Posted 31 Dec 2010 Link to this post

    You know what would make a good theme addition is scrollbars / scrollviewer and listview. I'm using the expression dark theme in my app (Q3 2010 Telerik controls) and the default scrollbar looks awful! 

    Cheers, 
  8. Nikolay
    Admin
    Nikolay avatar
    3997 posts

    Posted 31 Dec 2010 Link to this post

    Hello Wagner,

    Thanks for the suggestion. We will definitely consider it.

    Best wishes,
    Nick
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for WPF
  9. Thomas
    Thomas avatar
    2 posts
    Member since:
    Jul 2012

    Posted 10 Jul 2012 Link to this post

    I don't understand that point on Telerik argumentation, the control have custom property so take care of it yourself, yes sure, what about a dynamic theme switch application ?
    I want to be able to use the Expression Dark theme, and the Transparent Theme, one with a light background, one with a dark background.
    How do I customize my status bar now, which background, which foreground for my content  ?
    It the same in the reply of the question "why is there no Text for a progress bar", the answer = add a text on top of it, yes sure, which foreground color ?

    As long as you provide theme, and as long as my application may use them, I would like to be able to dynamically style the non Telerik control especially since you don't want to provide a specific object for each of them (which is really understandable by the way), just because I would like my application to be consistent with the theme provided.

    Can you explain to me how to style my status bar in function of the Telerik user-chosen theme ?
    Does all your theme contain Static Resource with consistent names we can use to define the basic background border and foreground of the non telerik controls ?

    Thanks.
  10. Yana
    Admin
    Yana avatar
    5013 posts

    Posted 12 Jul 2012 Link to this post

    Hello Thomas,

    With the Q1 SP1 release of RadControls we introduced a new way to style our controls using Implicit Styles.  This approach makes it much easier to customize the Telerik themes, to add new Styles to them and to switch the themes at runtime.

    I've attached a simple project to demonstrate how you could style MS controls in order to be consistent with RadControls. Note that I copied the needed xaml files from Themes.Impicit folder as explained in the article and added to System.Windows.xaml for both ExpressionDark and Transparent themes the style for the StatusBar:

    <Style x:Key="StatusBarStyle" TargetType="StatusBar">
        <Setter Property="Foreground" Value="{StaticResource ControlForeground_Normal}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="StatusBar">
                    <Border
                            BorderThickness="1"
                            Padding="{TemplateBinding Control.Padding}"
                            BorderBrush="{StaticResource ControlOuterBorder_Normal}"
                            Background="{StaticResource ControlBackground}"
                            SnapsToDevicePixels="True">
                        <ItemsPresenter SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="StatusBar" BasedOn="{StaticResource StatusBarStyle}" />

    Please download the attachment and give it a try.

    Kind regards,
    Yana
    the Telerik team

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

  11. Thomas
    Thomas avatar
    2 posts
    Member since:
    Jul 2012

    Posted 12 Jul 2012 Link to this post

    Thanks for the reply and the sample, I guess I will give a try to the implicit theme feature when you cover all your controls this way (like gauge and chart) but it looks promising ! in the mean time I guess I will try to figure out how to work around those small issues.
  12. Sia
    Admin
    Sia avatar
    765 posts

    Posted 16 Jul 2012 Link to this post

    Hello Wagner,

    Unfortunately there are design limitations in our RadChart control that stop us from adding support for implicit styling. When speaking about RadGauge, the new control which is shipped with the DataVisualization assembly supports implicit styling and we recommend upgrading to it if possible.

    All the best,
    Sia
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top