Set Design-time theme

6 posts, 0 answers
  1. Niklas
    Niklas avatar
    3 posts
    Member since:
    Apr 2011

    Posted 19 Sep 2011 Link to this post

    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
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 20 Sep 2011 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Niklas
    Niklas avatar
    3 posts
    Member since:
    Apr 2011

    Posted 20 Sep 2011 Link to this post

    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?
  5. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 20 Sep 2011 Link to this post

    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 >>

  6. Dmitry
    Dmitry avatar
    20 posts
    Member since:
    Apr 2011

    Posted 25 Oct 2014 Link to this post

    Are there any news on setting DesignTime theme to work with controls in VS Designer?
  7. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 27 Oct 2014 Link to this post

    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.

     
Back to Top
UI for WPF is Visual Studio 2017 Ready