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

Custom Theme

8 Answers 95 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rav
Top achievements
Rank 2
Rav asked on 02 Dec 2011, 09:30 AM
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

8 Answers, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 05 Dec 2011, 09:00 AM
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 >>
0
Rav
Top achievements
Rank 2
answered on 06 Dec 2011, 06:07 AM
Thanks Dani

But what do we use for a Custom Theme - writing telerik:Stylemanger.Theme="PS.SL.Themes.Metro.MetroTheme" does not work
0
Rav
Top achievements
Rank 2
answered on 06 Dec 2011, 06:07 AM
Thanks Dani

But what do we use for a Custom Theme - writing telerik:Stylemanger.Theme="PS.SL.Themes.Metro.MetroTheme" does not work
0
Rav
Top achievements
Rank 2
answered on 06 Dec 2011, 06:08 AM
Thanks Dani

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

telerik:Stylemanger.Theme="PS.SL.Themes.Metro.MetroTheme"
0
Rav
Top achievements
Rank 2
answered on 06 Dec 2011, 06:08 AM
Thanks Dani

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

telerik:Stylemanger.Theme="PS.SL.Themes.Metro.MetroTheme"
0
Dani
Telerik team
answered on 06 Dec 2011, 01:30 PM
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 >>
0
Rav
Top achievements
Rank 2
answered on 08 Dec 2011, 07:23 AM
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.
0
bird
Top achievements
Rank 1
answered on 12 Dec 2011, 02:41 AM
Hi Dani
        can you tell me how to visa click one  button ,the all radforms will show me another theme! 
 
Thank u!
Tags
General Discussions
Asked by
Rav
Top achievements
Rank 2
Answers by
Dani
Telerik team
Rav
Top achievements
Rank 2
bird
Top achievements
Rank 1
Share this question
or