This is a migrated thread and some comments may be shown as answers.

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

11 Answers 583 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Wagner
Top achievements
Rank 1
Wagner asked on 28 Apr 2010, 09:48 AM
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

11 Answers, 1 is accepted

Sort by
0
Accepted
Pana
Telerik team
answered on 29 Apr 2010, 03:10 PM
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.
0
Wagner
Top achievements
Rank 1
answered on 29 Apr 2010, 03:46 PM
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
0
Accepted
Pana
Telerik team
answered on 29 Apr 2010, 04:04 PM
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.
0
William Baker
Top achievements
Rank 1
answered on 17 Jun 2010, 08:44 AM
What about label or texblock controls?
0
Pana
Telerik team
answered on 17 Jun 2010, 10:02 AM
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
 
0
Andrew Thompson
Top achievements
Rank 1
answered on 31 Dec 2010, 10:43 AM
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, 
0
Nikolay
Telerik team
answered on 31 Dec 2010, 11:35 AM
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
0
Thomas
Top achievements
Rank 1
answered on 10 Jul 2012, 06:25 AM
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.
0
Yana
Telerik team
answered on 12 Jul 2012, 09:53 AM
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 >>

0
Thomas
Top achievements
Rank 1
answered on 13 Jul 2012, 12:49 AM
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.
0
Sia
Telerik team
answered on 16 Jul 2012, 03:35 PM
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.

Tags
General Discussions
Asked by
Wagner
Top achievements
Rank 1
Answers by
Pana
Telerik team
Wagner
Top achievements
Rank 1
William Baker
Top achievements
Rank 1
Andrew Thompson
Top achievements
Rank 1
Nikolay
Telerik team
Thomas
Top achievements
Rank 1
Yana
Telerik team
Sia
Telerik team
Share this question
or