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

Set Design-time theme

5 Answers 296 Views
Installer and Visual Studio Extensions
This is a migrated thread and some comments may be shown as answers.
Niklas
Top achievements
Rank 1
Niklas asked on 19 Sep 2011, 08:06 AM
Hi,
is it somehow possible to declare the telerik theme so that the controls would have their theme set in designer also?

I'm already setting theme code behind in Application_Startup like

StyleManager.ApplicationTheme = new Expression_DarkTheme();

But I would like to set the theme application wide so that I could see the rad controls wiht the dark theme also in design mode.

Best regards,
Niklas

5 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 20 Sep 2011, 07:40 AM
Hi Niklas,

 
When you set the theme on an application level you will be able to see the theme at runtime, not at design time. If you want to have design-time support you should set it on a control level, as shown below:

<telerik:RadGridView telerik:StyleManager.Theme="Expression_Dark"  ItemsSource="{Binding Collection}"/>


Best wishes,
Vanya Pavlova
the Telerik team

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

0
Niklas
Top achievements
Rank 1
answered on 20 Sep 2011, 07:43 AM
Hi,
this is not a good solution cause I would have to set the theme design time for _all_my_controls_ and what about when I would want to change the application wide theme then in code behind at runtime?
0
Vanya Pavlova
Telerik team
answered on 20 Sep 2011, 08:07 AM
Hi Niklas,

 


Currently for the design-time support this is the only available option - to set the theme on a control level. 
In a similar manner you may change the theme on multiple controls using a plain RadComboBox, as shown below:

<telerik:RadComboBox x:Name="combo"SelectedIndex="0"HorizontalAlignment="Right"Height="32"Margin="0,64,128,0"VerticalAlignment="Top"Width="152">
        <telerik:Office_BlackTheme/>
        <telerik:Office_BlueTheme/>
        <telerik:Office_SilverTheme/>
        <telerik:Expression_DarkTheme/>
        <telerik:MetroTheme/>
    </telerik:RadComboBox>
    <telerik:RadGridView telerik:StyleManager.Theme="{Binding ElementName=combo,Path=SelectedItem}"  ItemsSource="{Binding Mode=OneWay}"HorizontalAlignment="Left"Width="208"/>
    <telerik:RadButtontelerik:StyleManager.Theme="{Binding ElementName=combo,Path=SelectedItem}"  Height="22"VerticalAlignment="Bottom"Content="Click me"/>
    <telerik:RadCalendartelerik:StyleManager.Theme="{Binding ElementName=combo,Path=SelectedItem}"Margin="240,184,224,82"/>


One you pick the theme from the RadComboCox control it will be applied to all controls bound in this way and you will have the desired design-time support.
Regarding the application runtime theme change you may refer to the following forum thread for further reference. The same is valid for WPF as well. 


All the best,
Vanya Pavlova
the Telerik team

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

0
Dmitry
Top achievements
Rank 1
answered on 25 Oct 2014, 01:43 PM
Are there any news on setting DesignTime theme to work with controls in VS Designer?
0
Vanya Pavlova
Telerik team
answered on 27 Oct 2014, 11:36 AM
Hi Dmitry,


Thank you for contacting us.

The approach described above is valid for design-time support of Visual Studio designer, as well. 
In addition to this, I strongly recommend you to use Implicit Styles, rather than StyleManager. 
You could read more in our online documentation, following this link. 


Regards,
Vanya Pavlova
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Installer and Visual Studio Extensions
Asked by
Niklas
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Niklas
Top achievements
Rank 1
Dmitry
Top achievements
Rank 1
Share this question
or