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

Theme not showing up in design mode in Expression Blend

6 Answers 186 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jacob Rillema
Top achievements
Rank 1
Jacob Rillema asked on 15 Dec 2010, 01:46 AM
Why is my theme not working while in design mode inside Expression Blend? I would think this would be very straight forward to pull up? It is always showing the default Office Black theme. What do I need to get the correct theme to show up in design mode while in Blend correctly? What is really interesting is that the VS2010 XAML editor does correctly show the theme in design mode however Expression Blend is not grabbing it. Is this some assembly reference location issue of some sort?

Note this is what I am using for the theme at the control level and like I mentioned it does show up in VS 2010 design mode.

<telerikNavigation:RadPanelBar x:Name="MenuStackPanel"
                                             Orientation="Vertical"
                                             ItemsSource="{Binding NavigationsPanelItems}"
                                             telerik:StyleManager.Theme="Expression_Dark"/>

OK, I figured it out. When using a design class for design data in Expression Blend I had to put the following into my constructor for the theme to get render while in design mode.
    public partial class MainWindowDesign
    {
        public MainWindowDesign()
        {
            StyleManager.ApplicationTheme = new Expression_DarkTheme();
        }
        }

here is a snipped of my XAML UserControl.
<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation
                    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml
                    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006
                    xmlns:AdminSL="clr-namespace:Admin.SL" 
                    x:Class="Admin.SL.MainWindow" 
                    d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type=AdminSL:MainWindowDesign}"
                    mc:Ignorable="d">

Thanks in advance,
Jake

6 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 20 Dec 2010, 01:31 PM
Hello Jacob Rillema,

Unfortunately we couldn't reproduce your issue. Still, if you can send us a sample project reproducing the issue, then we will be able to further investigate it. Also, you can check this video and let me know if I am missing something.

Best wishes,
Tina Stancheva
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Samir
Top achievements
Rank 1
answered on 14 Sep 2011, 10:53 PM
Hello Jacob,

I also wanted Blend to display the controls using my desired theme. Although using telerik:StyleManager.Theme=Metro in each control did the trick at a control-level, I wanted an application-wide solution. My solution was to create a Class like so:
    public class TelerikThemeManager : DependencyObject
   {
        public TelerikThemeManager()
        {
            StyleManager.ApplicationTheme = new MetroTheme();
        }
    }
and instantiate it in the Resources section in the App.xaml. I hope it helps anyone with the same issue.

Best Wishes,
Samir Zattar

0
gk
Top achievements
Rank 1
answered on 27 Sep 2011, 11:10 PM
Good trick, thanks Samir.
0
Peter
Top achievements
Rank 1
answered on 05 May 2012, 05:25 PM
Samir, thanks

As a newbie, how do I instantiate this in the Application Resources?
0
Samir
Top achievements
Rank 1
answered on 07 May 2012, 01:55 PM
Example assuming TelerikThemeManager is in the namespace MyApp.Helpers:
<Application x:Class="MyApp.App"
xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
xmlns
:helpers="clr-namespace:MyApp.Helpers"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"/>

    <Application.Resources>

        <helpers:TelerikThemeManager x:Key="TelerikThemeManager" />

    </Application.Resources>

</Application>
0
Peter
Top achievements
Rank 1
answered on 07 May 2012, 02:37 PM
Thanks Samir, that's wonderful!!
Tags
General Discussions
Asked by
Jacob Rillema
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Samir
Top achievements
Rank 1
gk
Top achievements
Rank 1
Peter
Top achievements
Rank 1
Share this question
or