Custom Theme

9 posts, 0 answers
  1. Rav
    Rav avatar
    36 posts
    Member since:
    Nov 2011

    Posted 02 Dec 2011 Link to this post

    Hi Telerik

    We have created a custom theme project inside our Visual Studio solution (based on the Metro theme) and this works well at runtime. We use the following to set the Theme inside app.xaml.cs:

    StyleManager.ApplicationTheme = new PS.SL.Themes.Metro.MetroTheme();
    

    Unfortunately, the theme does not show in the design time inside Expression Blend. Instead it shows the default Office Black. Is there any way to fix this?

    Rav
  2. Dani
    Admin
    Dani avatar
    848 posts

    Posted 05 Dec 2011 Link to this post

    Hi Rav,

    You can view your custom theme in design view if you set it explicitly on any control. When you set an application theme Blend is unable to render it in the Design view, but for testing purposes you can set the custom theme in the regular manner. The following will show a Metro styled RadComboBox in Blend:

    <telerik:RadComboBox Margin="20" VerticalAlignment="Center" HorizontalAlignment="Left" Width="200" telerik:StyleManager.Theme="Metro">
                <telerik:RadComboBoxItem Content="Item 1"/>
                <telerik:RadComboBoxItem Content="Item 2"/>
                <telerik:RadComboBoxItem Content="Item 3"/>
            </telerik:RadComboBox>

    I hope this will be helpful.

    Best wishes,
    Dani
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft banner
  4. Rav
    Rav avatar
    36 posts
    Member since:
    Nov 2011

    Posted 06 Dec 2011 Link to this post

    Thanks Dani

    But what do we use for a Custom Theme - writing telerik:Stylemanger.Theme="PS.SL.Themes.Metro.MetroTheme" does not work
  5. Rav
    Rav avatar
    36 posts
    Member since:
    Nov 2011

    Posted 06 Dec 2011 Link to this post

    Thanks Dani

    But what do we use for a Custom Theme - writing telerik:Stylemanger.Theme="PS.SL.Themes.Metro.MetroTheme" does not work
  6. Rav
    Rav avatar
    36 posts
    Member since:
    Nov 2011

    Posted 06 Dec 2011 Link to this post

    Thanks Dani

    But what do we use for a Custom Theme - writing this does not work:

    telerik:Stylemanger.Theme="PS.SL.Themes.Metro.MetroTheme"
  7. Rav
    Rav avatar
    36 posts
    Member since:
    Nov 2011

    Posted 06 Dec 2011 Link to this post

    Thanks Dani

    But what do we use for a Custom Theme - writing this does not work:

    telerik:Stylemanger.Theme="PS.SL.Themes.Metro.MetroTheme"
  8. Dani
    Admin
    Dani avatar
    848 posts

    Posted 06 Dec 2011 Link to this post

    Hi Rav,

    Try setting your custom theme as a StaticResource and then reference it:
    <UserControl.Resources>
        <local:MyCustomTheme x:Key="Theme" />
    </UserControl.Resources>
      
    <telerik:RadComboBox telerik:StyleManager.Theme="{StaticResource Theme}" />

    I hope this helps.

    Best wishes,
    Dani
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  9. Rav
    Rav avatar
    36 posts
    Member since:
    Nov 2011

    Posted 08 Dec 2011 Link to this post

    Hi Dani

    Unfortunately it did not, I now get this error inside Expression Blend:

    An object of type "PS.SL.Themes.Metro.MetroTheme" cannot be applied to a property that expects the type "Telerik.Windows.Controls.Theme".

    My theme class is inheriting from Telerik.Windows.Controls.Theme just as you specified in your previous post.
  10. bird
    bird avatar
    6 posts
    Member since:
    May 2011

    Posted 11 Dec 2011 Link to this post

    Hi Dani
            can you tell me how to visa click one  button ,the all radforms will show me another theme! 
     
    Thank u!
Back to Top
DevCraft banner