Theme not showing up in design mode in Expression Blend

7 posts, 0 answers
  1. Jacob Rillema
    Jacob Rillema avatar
    8 posts
    Member since:
    Nov 2009

    Posted 14 Dec 2010 Link to this post

    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

  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 20 Dec 2010 Link to this post

    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
  3. DevCraft banner
  4. Samir
    Samir avatar
    3 posts
    Member since:
    May 2010

    Posted 14 Sep 2011 Link to this post

    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

  5. gk
    gk avatar
    24 posts
    Member since:
    Jul 2010

    Posted 27 Sep 2011 Link to this post

    Good trick, thanks Samir.
  6. Peter
    Peter avatar
    13 posts
    Member since:
    May 2012

    Posted 05 May 2012 Link to this post

    Samir, thanks

    As a newbie, how do I instantiate this in the Application Resources?
  7. Samir
    Samir avatar
    3 posts
    Member since:
    May 2010

    Posted 07 May 2012 Link to this post

    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>
  8. Peter
    Peter avatar
    13 posts
    Member since:
    May 2012

    Posted 07 May 2012 Link to this post

    Thanks Samir, that's wonderful!!
Back to Top
DevCraft banner